Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Command Line Arguments

by hel0 (Novice)
on Jul 07, 2000 at 18:40 UTC ( #21491=note: print w/replies, xml ) Need Help??


in reply to Command Line Arguments

I would do something like this:
my %ArgumentState(); foreach (@ARGV) { SWITCH: for ($_) { /^a/i && do { $ArgumentState{'foo'}='bar'; last; }; /^b/i && do { &Do_something_here; last; }; }; };
But it's all just a matter of personal preference I guess. I don't like creating objects for simple things like parsing the commandline. Regular expressions will also offer you much greater flexibility! Hel0

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2022-12-04 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?