Consider using Getopt::Long instead of hand-rolling your option parsing. Getopt::Long can also set up your callbacks but will handle many more features:
use Getopt::Long qw(:config pass_through); my $run; GetOptions( 'x|run-using-system' => sub { $run = \&system }, 'X|run-using-mysystem' => sub { $run = \&mysystem }, ); $run->(@ARGV);
In reply to Re^3: how to assign 'system' to a value, and eval it.
by Corion
in thread SOLVED:how to assign 'system' to a value, and eval it.
by vincentaxhe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |