use strict; use Getopt::Std; my $file; usage() unless ($ARGV[0]); my %opts; getopts ('h?',\%opts); usage() if (exists($opts{h})); usage() if (exists($opts{'?'}));