in reply to Interpret array elements as actual Perl?
You'd better go with an array of anonymous subs, IMHO.
my @commands = ( sub {print "hello\n"}, sub {print "world\n"} ); foreach my $command (@commands) { &{$command}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Interpret array elements as actual Perl?
by meetraz (Hermit) on May 28, 2004 at 18:38 UTC | |
by calin (Deacon) on May 28, 2004 at 18:57 UTC |