freebie:~ 1085> cat bar + 10:08:26 use strict; my %lists; for my $i ( keys %lists ) { my $coderef = \&{ $i }; &{ $coderef }(); } freebie:~ 1086> perl -c bar + 10:08:28 bar syntax OK
This is perfectly valid due to the goto exception I mentioned. If you read perldoc strict:
There is one exception to this rule: $bar = \&{'foo'}; &$bar; is allowed so that "goto &$AUTOLOAD" would not break unde +r stricture.
In reply to Re^3: Can't Reference a Sub by Variable when using Strict
by Fletch
in thread Can't Reference a Sub by Variable when using Strict
by Dru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |