# The following was supposedly scribed by
# A. Pagaltzis
# on Monday 20 June 2005 08:57 am:

>I don’t see how being able to *optionally* say something like
>
>    GetOptions(
>        [EMAIL PROTECTED],
>        # ...
>    );
>
>would detract from anything at all.

I don't think you really need to be able to pass a different array to 
GetOptions().  After all, that really is just meant for parsing 
command-line arguments, which aren't going to be found anywhere besides 
@ARGV.

What I do think  you need is a way to pass a different array to 
*something*, so that wrapping and reusing is easier:

Consider how things change if GetOptions were structured something like 
the following instead of having all of that tasty parsing logic stuck 
inside of it.

####
sub GetOptions {
        my $self = Getopt::Modern->create(@_);
        return($self->get([EMAIL PROTECTED]));
}
####

Now, if you wanted to write a wrapper (or even an api function (ala Tk) 
that took a mixed list of arguments and options), you would just call 
$opt->get([EMAIL PROTECTED]) instead of GetOptions().

To me, it mostly comes down to thinking "what the heck does ARGV have to 
do with anything?" everytime I see 'local @ARGV = @arglist'.

--Eric
-- 
I arise in the morning torn between a desire to improve the world and a
desire to enjoy the world. This makes it hard to plan the day.
--E.B. White
---------------------------------------------
    http://scratchcomputing.com
---------------------------------------------

Reply via email to