Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Command Line Arguments

by hel0 (Novice)
on Jul 07, 2000 at 18:40 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-16 21:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found