> my($what) = shift(@ARGV); > my($whatLower) = $what; > $whatLower =~ tr/[A-Z]/[a-z]/; $whatLower = lc($what); > if ($what eq undef) { well, if $what is undef you already have 2 warnings before you detect it. On with tr/// (or lc()) and the next right here. rather write: my $what = shift @ARGV; unless( defined $what and exists $dispatch{lc($what)} ){ Help(); exit defined($what) ? 0 : 1 } $dispatch{$whatLower}->(@ARGV); exit 0;