# The following was supposedly scribed by
# Johan Vromans
# on Friday 17 June 2005 08:14 am:

>> If it involves typing @main::ARGV, something is wrong.
>
>This is another one of your statements that feel like a religious
>issue. If typing @main::ARGV indicates that something is wrong, I
>think you have to address the Perl design and maintenance team.

This is not about the "look" of the variable name.  It's about a package 
modifying a global variable deep inside the core of its functionality.

Here's how I addressed the issue.  There's only one instance of ARGV in 
the code.  get() doesn't care what you pass it, so it's easier to wrap.  
You could even use it for parsing hash values in API functions.

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

I was wrong about that being @main::ARGV.  It's just @ARGV.

Anyway, this GetOptions() function is not meant to be wrapped, and it 
serves as a dirt-simple example of what to do if you want to wrap 
Getopt::Modern.

--Eric
-- 
Don't worry about what anybody else is going to do. The best way to
predict the future is to invent it.
--Alan Kay
---------------------------------------------
    http://scratchcomputing.com
---------------------------------------------

Reply via email to