Smoot Carl-Mitchell <[EMAIL PROTECTED]> wrote:
:
: On 3 Apr 2004 14:40:43 -0000
: [EMAIL PROTECTED] (Peter Scott) wrote:
:
: > In article <[EMAIL PROTECTED]>,
: > [EMAIL PROTECTED] (Smoot Carl-Mitchell) writes:
: > >
: > >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.
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>