I don't know how or where to put & how to use this $option.  
What if my Default value is a sql statement? Can I just include the name 
of the file handle between the brackets?



-----Original Message-----
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 29, 2001 6:40 PM
To: M.W. Koskamp
Cc: Evgeny Goldin (aka Genie); [EMAIL PROTECTED]
Subject: Re: Optional Variables


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