On Sat, 3 Apr 2004 11:04:35 -0600
"Charles K. Clarkson" <[EMAIL PROTECTED]> wrote:
> Smoot Carl-Mitchell <[EMAIL PROTECTED]> wrote:
> : > >sub test {
> : > >
> : > > my $arg;
> : > > $arg = shift or $arg = $_;
> : > >}
> : >
> : > Same problem as the last suggestion.
> :
> : And what specifically would the problem be?
>
> If $arg is 0 or undef, it will fail the test and $_
> will be used even though an argument was passed. Better
> to check the value of @_ to see if an argument was
> passed.
Good point.
Thanks
--
Smoot Carl-Mitchell
Systems/Network Architect
email: [EMAIL PROTECTED]
cell: +1 602 421 9005
home: +1 480 922 7313
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>