Re: Optional Arguments

2001-04-10 Thread Carl Jolley
On Tue, 10 Apr 2001, Dirk Bremer wrote: > Joe, > > Some clarification, the first two arguments are always required. Both the third >argument and fourth argument are optional and > positional. There would be instances where the fourth argument would have a valid >value but the third argument wo

Re: Optional Arguments

2001-04-10 Thread Carl Jolley
{next;} > > # Add the filename and file size to the hash pointed to by the > # specified hash reference. > $Hash->{$_} = sprintf('%7d',-s "${Dir}$_"); > } > > # Close the directory. > closedir(DIRHND); > return(

Re: Optional Arguments

2001-04-10 Thread Dirk Bremer
o:[EMAIL PROTECTED]> - Original Message - From: "Joe Schell" <[EMAIL PROTECTED]> To: "Dirk Bremer" <[EMAIL PROTECTED]> Cc: "perl-win32-users" <[EMAIL PROTECTED]> Sent: Tuesday, April 10, 2001 9:40 AM Subject: Re: Optional Arguments > Ev

Re: Optional Arguments

2001-04-10 Thread Joe Schell
"$Bill Luebkert" wrote: > > Joe Schell wrote: > > > > This works: > > > > if (scalar(@_) > 2) > > It's already in a scalar context, you don't need the scalar (). > > if (@_ > 2) { > True. But nothing wrong with making it explicit correct?

Re: Optional Arguments

2001-04-10 Thread Joe Schell
Dirk Bremer wrote: > > Joe, > > Some clarification, the first two arguments are always required. Both the third >argument and fourth argument are optional and > positional. There would be instances where the fourth argument would have a valid >value but the third argument would have some type

Re: Optional Arguments

2001-04-10 Thread Ron Grabowski
> of null value to indicate that it would not be used. I have tried passing under, "", '', " I think undef is your best bet: Depth( undef, undef, 'True', undef ); sub Depth { foreach my $param ( @_ ) { print "$param\n" if $param; } } > Depth($Dir,\%Files,'',15); > > The third argu

Re: Optional Arguments

2001-04-10 Thread Dirk Bremer
AIL PROTECTED]> To: "Dirk Bremer" <[EMAIL PROTECTED]> Cc: "perl-win32-users" <[EMAIL PROTECTED]> Sent: Monday, April 09, 2001 11:29 PM Subject: Re: Optional Arguments > Your example is passing four arguments not two which makes your question > rather c