Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Examples for using Getopt::Long

by bahadur (Sexton)
on May 10, 2005 at 09:26 UTC ( [id://455478]=note: print w/replies, xml ) Need Help??


in reply to Re: Examples for using Getopt::Long
in thread Examples for using Getopt::Long

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: Examples for using Getopt::Long
by gellyfish (Monsignor) on May 10, 2005 at 09:46 UTC

    Of course this all completely and thoroughly described in the Getopt::Long documentation and I really think you should spend a bit more time reading it yourself than asking questions here, however it is quite simply really: GetOptions gets passed a hash describing the options for the program that are to be passed: the key is the option itself with an optional type and the value is a reference to a variable which will receive the value of the option. So in the case of the  'u=s' => \$user you have an option -u which is a string and who's value will be placed in the variable $user. The options are parsed and placed in the appropriate variables when GetOptions is called - this is why the module only requires the single function.

    /J\

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found