in reply to Code Cleanup challenge!
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Code Cleanup challenge!
by kesterkester (Hermit) on Aug 12, 2003 at 17:33 UTC |