This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #105922] Allow any string before ->meth
authorFather Chrysostomos <sprout@cpan.org>
Thu, 20 Sep 2012 15:56:38 +0000 (08:56 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 20 Sep 2012 16:49:33 +0000 (09:49 -0700)
commit7156e69abfd37267e85105c6ec0c449ce4e41523
tree51de5000188aa344191f2d0e602b4c16d382a809
parentdaef195c35291c889b77ed7da9fc76644092aa45
[perl #105922] Allow any string before ->meth

The rules for filtering out what do not look like package names are
not logical and disallow valid things like "::main", while allowing
q"_#@*$!@*^(".

This commit simply lets any non-empty string be used as a package
name.  If it is a typo, you’ll get an error anyway.  This allows
autobox-style calls like "3foo"->CORE::uc, or even "3foo"->uc if you
set up @ISA first.

I made an exception for the empty string because it messes up caches
somehow and causes subsequent method calls all to be called on the
main package.  I haven’t looked into that yet.  I don’t know whether
it’s worth it.

The changes to the tests in cpan/Test-Simple have been submit-
ted upstream.
cpan/Test-Simple/t/fail-more.t
pp_hot.c
t/op/method.t
t/run/fresh_perl.t