in reply to More on Processing Command Line Arguments
And a quick cleanup:
#!/usr/bin/perl use warnings; use strict; use Getopt::Long; use Pod::Usage; #******************************************************** #** Process command line arguments. #******************************************************** GetOptions( 'add=s' =>\my $Add_Record, 'edit=s' =>\my $Edit_Record, 'list=s' =>\my $List_Records, 'view=s' =>\my $View_Record, 'man' => sub {pod2usage({-verbose => 2, -input => \*DATA})}, 'help|?' => sub {pod2usage({-verbose => 1, -input => \*DATA})}, ); if (($Add_Record xor $Edit_Record) xor ($List_Records xor $View_Record +)) { # Run Program } else { # Print manual } __END__ =head1 NAME somescript -- A utility for ... =head1 SYNOPSIS B<somescript --help> for more information somescript [options] Options:
Note a few things.
Cheers,
Ovid
New address of my CGI Course.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: More on Processing Command Line Arguments
by Ninthwave (Chaplain) on Oct 31, 2003 at 17:01 UTC | |
by Ovid (Cardinal) on Oct 31, 2003 at 17:08 UTC |