in reply to Re^2: Can't Reference a Sub by Variable when using Strict
in thread Can't Reference a Sub by Variable when using Strict

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.

Replies are listed 'Best First'.
Re^4: Can't Reference a Sub by Variable when using Strict
by chromatic (Archbishop) on Oct 04, 2004 at 17:50 UTC

    So it is; thanks!