- or download this
if (@ARGV == "clean"){ print "cleaning up dirs"; clean(); }
- or download this
if($ARGV[0] eq "clean") { # eq, not ==, for strings
print "cleaning up dirs";
clean();
}
- or download this
sub clean_handler
{
...
}
# ...
- or download this
my %cmds = (
'clean' => \&clean, # reference to the subroutine 'clean'
'make' => \&make, # reference to 'make'
# ...
);
- or download this
my $cmd = $cmds{$ARGV[0]}; # get the coderef
&$cmd(); # call it