On Fri, 29 Jun 2001, M.W. Koskamp wrote:


> > my $option = @ARGV ? shift : <DEFAULT VALUE>;
>
> Above option only works for 1 parameter tho (and commandline arguments).
> For function calls i like to use 'named parameters' by accepting a hash of
> options.

Well, yeah, but the topic *was* command-line arguments, not function
arguments.  You can easily loop through @ARGV, unshifting as you go, until
@ARGV is depleted and default values assigned.

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
A free society is one where it is safe to be unpopular.
                -- Adlai Stevenson

Reply via email to