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
{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(
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
"$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?
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
> 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
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