----- Original Message -----
From: Felix Li <[EMAIL PROTECTED]>
Date: Friday, December 10, 2004 9:48 am
Subject: looking a one liner "to return the value while clearing the argument"

> Hi,
Hello
> 
> Is there "a one liner" that performs the equivalent of
usualy a "one liner" , is something that you from your shell, interest in how 
this can be used properly from the shell. You probebly mean, a shorter way of 
writing your function ??
> 
> sub ReturnAndClear {
>   my $temp=$_[0];
>   $_[0]=undef;
>   return $temp;
>    };
> 

#you should call this (\SCALAR)
sub ReturnAndClear{ return $_[0] && undef ${$_[0]}  } 

> TIA
> 
> felix li
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to