in reply to Can't Reference a Sub by Variable when using Strict
Erm, because that's what use strict does. You either need to use coderefs (my %lists = ( stuff => \&test1, things => \&test2 );), or use the grandfathered goto syntax:
for my $i ( keys %lists ) { my $coderef = \&{ $i }; &{ $coderef }; }
Read perldoc strict for more details.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can't Reference a Sub by Variable when using Strict
by chromatic (Archbishop) on Oct 04, 2004 at 06:18 UTC | |
by broquaint (Abbot) on Oct 04, 2004 at 07:41 UTC | |
by tachyon (Chancellor) on Oct 04, 2004 at 12:32 UTC | |
by Fletch (Bishop) on Oct 04, 2004 at 14:13 UTC | |
by chromatic (Archbishop) on Oct 04, 2004 at 17:50 UTC |