if (@ARGV = "h" ) is actually an assignment. You are overwriting @ARGV and making it a single element array containing 'h'. Using two equal signs == is an arithmetic comparison, so I think you mean: if ($ARGV[0] eq 'h') However you will get a warning from this (you are setting warnings, right?) so: if (@ARGV && $ARGV[0] eq 'h') This checks that @ARGV actually has some elements.