Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Command line args

by azatoth (Curate)
on Jun 06, 2001 at 19:09 UTC ( [id://86258]=note: print w/replies, xml ) Need Help??


in reply to Command line args

Alternatively, check out Getopt::Long. You'll like it.

#it's easy, mm-kay? a snippet from one of my scripts. use Getopt::Long; my %opt = (); GetOptions(\%opt, "rhost=s", # remote host as a (s)tring "ruser=s", # remote username as a (s)tring "rpwd=s", # remote password as a (s)tring "localDir=s", # local directory as a (s)tring ) or die "Invalid Command Line Options!\n"; #then use like this do_this() if $opt{rhost}; do_that() if $opt{ruser}; chdir $opt{localDir}; #etc etc
Update : Bah, runrig beat me to it.

Azatoth a.k.a Captain Whiplash

Make Your Die Messages Full of Wisdom!
Get YOUR PerlMonks Stagename here!
Want to speak like a Londoner?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-20 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found