in reply to What's the best way to make my script execute different sections without using goto?
Getopt::Long will help you here.
In a more general situation, you'd want a dispatch table.
my %actions = ( action1 => \&action1, action2 => \&action2, action3 => \&action3, ); my $action_sub = $actions{$action} or die("Unknown action $action\n"); $action_sub->(@ARGV);
|
---|