diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-07-06 14:19:21 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-07-06 22:26:32 -0700 |
commit | 39c012bc2fc2f1cf310f6d4ba499ec58a7bad900 (patch) | |
tree | 5e16f7a8ff0b4817fc15f36c7c9e2a82352bd82c /ext/VMS-Stdio | |
parent | a4fd4a89a854c8ba9dbb6aa0202632e82dadbf84 (diff) | |
download | perl-39c012bc2fc2f1cf310f6d4ba499ec58a7bad900.tar.gz |
rv2cv hooks should not create 2nd-class subs
$ perl5.17.2 -Mblib -e 'sub foo{}; foo $bar; use Lexical::Sub baz => sub{}; baz $bar'
Can't call method "baz" on an undefined value at -e line 1.
$ perl5.17.2 -Mblib -e 'sub foo{}; foo bar; use Lexical::Sub baz => sub{}; baz bar'
Can't locate object method "baz" via package "bar" (perhaps you forgot to load "bar"?) at -e line 1.
So if you use Lexical::Sub, your sub doesn’t get to participate in
determining whether ‘foo $bar’ or ‘foo bar’ is a method call.
This is because Lexical::Sub uses an rv2cv hook to intercept sub
lookup. And toke.c:S_intuit_method thinks there cannot be a CV with-
out a GV (which was the case when it was first written).
Commit f7461760 introduced this rv2cv hooking for bareword lookup, but
failed to update S_intuit_method accordingly.
Diffstat (limited to 'ext/VMS-Stdio')
0 files changed, 0 insertions, 0 deletions