Here's another suggestion. You can use Getopt and POD (plain ond documentation). All of your command line options are stored in a single hash for easy lookup.
use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
# Process and validate the command line options in @ARGV.
my %options;
my $parse = new Getopt::Long::Parser;
if (!($parse->getoptions('infile=s', \($options{infile}),
'outfile=s', \($options{outfile}),
'help', \($options{help})))) {
help();
}
if (not defined($options{infile})) {
help();
}
sub help
{
pod2usage(0);
}
__END__
=head1 NAME
A.pl - Creates A file
=head1 SYNOPSIS
A.pl [options]
Options:
--infile=[file]
--help
=over 3
=item B<--infile -i=[file]>
A file that is used for input, wildcards are allowed
=item B<--outfile -o=[file]>
Optional parameter for the output file
=item B<--help -h -?>
Print a brief help message and exits.
=head1 DESCRIPTION
B<This program> creates a A files.
=cut