(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); }
In reply to Re: Re: Interpret array elements as actual Perl?
by meetraz
in thread Interpret array elements as actual Perl?
by McMahon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |