in reply to Re^8: how to deal with 20 commands
in thread how to deal with 20 commands

Ah...I see what you're saying now. You want the ability to have the arguments parser act upon arbitrary arrays as opposed to always acting on @ARGV. If this gets implemented, I'd sure like to see @ARGV be the default. Because, just like in the examples that you site above, @ARGV will be what 99.99% of the people want. Of course, the devil's in that extra 0.001%. Something in the back of my mind tells me that Perl6 has multi-dispatch ala Java where you can have mutliple subroutines called the same thing, but the one that gets called is the one that has the right signature. If this is the case, you could do something like:
sub GetOpts() { GetOpts(@ARGV); } sub GetOpts(@array) { #the real work is done here }

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Replies are listed 'Best First'.
Re^10: how to deal with 20 commands
by gaal (Parson) on May 24, 2005 at 12:56 UTC
    Sure.

    In Perl 6, That would probably be spelled:

    sub GetOptions(?@args = @*ARGS is rw) { ... } This is so easy to do (it isn't that much harder in Perl 5!), it's a pity it wasn't done already.