Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Another Getopt::Long questions

by kelan (Deacon)
on Apr 10, 2003 at 14:42 UTC ( #249632=note: print w/replies, xml ) Need Help??


in reply to Re: Another Getopt::Long questions
in thread Another Getopt::Long questions

I don't remember if it's mentioned specifically in the POD, but from my usage, the first option is always the name of the key it will use. This is handy when you want to use one character options or bundling. As in:

use Getopt::Long; Getopt::Long::Configure('bundling'); my %options; GetOptions( \%options, 'LongName|L=s' ); if ($options{LongName}) { # do something with $options{LongName} }
And the user can specify that option either as:
prog.pl --longname something
or
prog.pl -L something

kelan


Perl6 Grammar Student

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://249632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2022-12-10 05:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?