# Test if the is an argument if(!@ARGV) { die "My help message\n"; } # Test if the argument is a file if(! -e $ARGV[0]) { print "File $ARGV[0] does not exist\n"; }