Ask a Question related to PERL Beginners, Design and Development.
-
tbrowner@digidyne.com #1
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
tbrowner@digidyne.com Guest
-
DNS Options?
Am in the process of setting up a 2003 domain and understand that DNS is essential, any advice would be greatly appreciated. A future step will be... -
What is an options key?
What is an options key & where is it? -
OS options for Sun PC
Hi all! I have these old Sun PC cards. (Not the latest version) I have never felt like installing any PC-software on my nice and clean... -
SET OPTIONS
Can someone tell me how I can tell what set options a procedure has, I am looking for any procedure or view that has SET QUOTED_IDENTIFIER OFF OR... -
Options and creating a macro for options
I have a database that i use for work and have set up to have 10-12 option groups on one page. Normally I would "hit" the "Pass" option (the other... -
Dan Muey #2
RE: Help with options
> Hi,
There are module sto help you process switches and what not.>
> 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.
>
For really simple stuff I do:
if($ARGV[0] eq '-h') { print "Here is how to use this script...."; }
elsif(!defined $ARGV[1]) { print "You must specify the Foo for Monkey, try -h for help..."; }
Something like that anyway.
HTH
DMuey
<http://learn.perl.org/> <http://learn.perl.org/first-response>> Thanks,
> Thomas Browner
>
>
>
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
Dan Muey Guest
-
Paul Kraus #3
RE: Help with options
Getopt::long
[url]http://search.cpan.org/~jv/Getopt-Long-2.34/lib/Getopt/Long.pm[/url]
Paul Kraus
-----------------------
PEL Supply Company
Network Administrator
> -----Original Message-----
> From: Thomas Browner [mailto:thomas.browner@digidyne.com] On Behalf Of
> [email]tbrowner@digidyne.com[/email]
> Sent: Tuesday, January 27, 2004 5:22 PM
> To: [email]beginners@perl.org[/email]
> 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]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
Paul Kraus Guest
-
Tim #4
RE: Help with options
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
>
>[url]http://search.cpan.org/~jv/Getopt-Long-2.34/lib/Getopt/Long.pm[/url]
>
>
> Paul Kraus
> -----------------------
> PEL Supply Company
> Network Administrator
>>> > -----Original Message-----
> > From: Thomas Browner [mailto:thomas.browner@digidyne.com] On Behalf Of
> > [email]tbrowner@digidyne.com[/email]
> > Sent: Tuesday, January 27, 2004 5:22 PM
> > To: [email]beginners@perl.org[/email]
> > 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]beginners-unsubscribe@perl.org[/email]
> > For additional commands, e-mail: [email]beginners-help@perl.org[/email]
> > <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>--
>To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
>For additional commands, e-mail: [email]beginners-help@perl.org[/email]
><http://learn.perl.org/> <http://learn.perl.org/first-response>Tim Guest



Reply With Quote

