I realize there's no 'help' in this one, but maybe this will get you on your way...(it's a bit of a kluge; I had to check it twice)

Here's one with GetOpt::Std :
##########################
use Getopt::Std;

my @ARGS;
my %opts;
eval
{
getopts('o:L', \%opts) or die "Usage: $0 -o [ mail || file ] [-L]\n\t where\t-o mail = mailed output OR -o file = output to files\n\t\t-L = create log file\n";
die "Usage: $0 -o [ mail || file ] [-L]\n\t where\t-o mail = mailed output OR -o file = output to files\n\t\t-L = create log file\n"
unless ( (exists $opts{o})&&(($opts{o} eq "mail")||($opts{o} eq "file")));
};
if ( $@ ) {
#mail & die
...
}
###########################


At 12:21 PM 1/28/04 -0500, you wrote:
Getopt::long

http://search.cpan.org/~jv/Getopt-Long-2.34/lib/Getopt/Long.pm


Paul Kraus ----------------------- PEL Supply Company Network Administrator

> -----Original Message-----
> From: Thomas Browner [mailto:[EMAIL PROTECTED] On Behalf Of
> [EMAIL PROTECTED]
> Sent: Tuesday, January 27, 2004 5:22 PM
> To: [EMAIL PROTECTED]
> Subject: Help with options
>
> Hi,
>
> I have a script that command options are taken and would like to know
> how print out the options when the options are missing from the command
> line. Or how to do a -h to print out the options.
>
> Thanks,
> Thomas Browner
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Reply via email to