in reply to Re: Interpret array elements as actual Perl?
in thread Interpret array elements as actual Perl?
(Using subname() instead of &subname)use strict; my @commands = ( sub {print "hello\n"}, sub {print "world\n"}, ); foreach my $command (@commands) { $command->(); # Or use args like this: $command->($arg1,$arg2); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Interpret array elements as actual Perl?
by calin (Deacon) on May 28, 2004 at 18:57 UTC |