[Chicago-talk] alternatives to Getopt::Long
Mike Fragassi
frag at ripco.com
Fri May 7 16:16:17 CDT 2004
On Fri, 7 May 2004, Wiggins d Anconia wrote:
> > GetOptions('foo=s+' => \@foo); # or 'foo=sl', or 'foo=S', or whatever
>
> If I understand correctly it is so that there can be a distinction
> between what is an argument and what is an input file. Normally the
Fair enough -- if you're creating an app for public release that may take
files as STDIN. I'm creating an in-house script only to be used by admins
that works on our database tables and that does nothing with STDIN. Put
another way, I'm not worried if the contents of @ARGV get slurped up into
the last option's array, because @ARGV should be empty by the time
GetOptions() finishes, or else there's an error. So, in my situation,
what I want to do makes sense. I'm certainly not proposing it become
Getopt::Long's default behavior.
> an input file. Enter the commas, verbose switching, etc. The + is an
> interesting notion but adds one additional step and complexity just to
> prevent the need for user to "just do it the way everyone else does".
> To me this adds testing steps, documentation, (dumb) user support, etc.
Well, yeah, but Getopt::Long ain't a dainty beast in the first place, and
this struck me as an obvious feature that'd probably would add very little
complexity, rather than the equivalent of giving the module a mail reader.
The prospect of having code with testing steps is kind of what I was
hoping to find if someone knew of an applicable CPAN module.
-- Mike F.
More information about the Chicago-talk
mailing list