This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #113050] Put fallback back under "()"
authorFather Chrysostomos <sprout@cpan.org>
Wed, 23 May 2012 08:05:20 +0000 (01:05 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 23 May 2012 13:01:23 +0000 (06:01 -0700)
commit3866ea3be51f0998b848d22c4ef960965bda7199
tree0bdd788345c8cb865f6aa7c4358c6896c38867ea
parent1204c818c5b6fdbe987017df9f2ce0e68463f315
[perl #113050] Put fallback back under "()"

Unfortunately, there is code all over CPAN that assumes fallback is
stored under the "()" stash entry.  And that code also assumes that
the overloadedness flag (the existence of the CV) is in the same spot.
So much for encapsulation.

This commit changes overloading itself to use a different key, "((",
while having it search for "()" first, and then "((" only if "()" is
not found, to preserve compatibility with encapsulation-breaking code.

So the "((" key will only be used by gv.c if there is no fallback
value specified at all.
gv.c
lib/overload.pm
lib/overload.t