|
|
| "be consistent" | |
| PerlMonks |
Re: Argdom.pmby Hofmator (Curate) |
| on Nov 10, 2006 at 10:47 UTC ( #583317=note: print w/ replies, xml ) | Need Help?? |
|
Well, another command-line-parsing-module ... but I must say, I prefer Getopt::Long which is a core module and therefore available everywhere. In addition to that, there are plenty of tests for Getopt::Long, it is more flexible and easier to use (eg. no need to define subs that match the arguments by hand). Apart from that, your module has a couple of problems, eg. it doesn't need Exporter, has a inconsistent interface (why can I say my @singles = $a->getSingles; but not my %keyvals = $a->getKeys), ... To underline my point, I have rewritten the script given in your POD using Getopt::Long. The only difference is that '-4Adam;Barbara' is now written as two arguments -4 and 'Adam;Barbara'. Btw, your script as given doesn't compile, it uses croak without use Carp; - I have replaced that with a simple warn.
-- Hofmator Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In Section
Code Catacombs
|
|
||||||||||||||||||||||