use strict; use Pod::Usage; use Getopt::Long; ## Parse options my %opt; GetOptions(\%opt, "help|?", "man", "flag1") || pod2usage(2); pod2usage(1) if ($opt{help}); pod2usage(-exitval => 0, -verbose => 2) if ($opt{man}); ## Check for too many filenames pod2usage("$0: Too many files given.\n") if (@ARGV > 1);