http://qs321.pair.com?node_id=21491


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