So my question is why?#!/perl/bin/perl # # coderefs.pl -- Yes you can use strict... use strict; use warnings; use diagnostics; for (qw(foo bar)) { ($main::{$_} or sub { print "No such sub: $_\n" })->(); } $_ = 'baz'; $main::{$_}(); # works! but, &{$_}(); # doesn't... sub foo { print "Yes, I'm here.\n"; } sub baz { print "I'm here as well.\n"; } __END__
–hsm
"Never try to teach a pig to sing…it wastes your time and it annoys the pig."In reply to Re: Re: Random Tips on Parse::RecDescent
by hsmyers
in thread Random Tips on Parse::RecDescent
by hsmyers
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |