Re: looking a one liner "to return the value while clearing the argument"

2004-12-11 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Edward WIJAYA) writes: >On Fri, 10 Dec 2004 09:48:26 -0500, Felix Li <[EMAIL PROTECTED]> >wrote: > >> Is there "a one liner" that performs the equivalent of >> sub ReturnAndClear { >>my $temp=$_[0]; >>$_[0]=undef; >>return $temp; >>

Re: looking a one liner "to return the value while clearing the argument"

2004-12-10 Thread mgoland
- 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 usual

looking a one liner "to return the value while clearing the argument"

2004-12-10 Thread Felix Li
Hi, Is there "a one liner" that performs the equivalent of sub ReturnAndClear { my $temp=$_[0]; $_[0]=undef; return $temp; }; TIA felix li

Re: looking a one liner "to return the value while clearing the argument"

2004-12-10 Thread Edward WIJAYA
On Fri, 10 Dec 2004 09:48:26 -0500, Felix Li <[EMAIL PROTECTED]> wrote: Is there "a one liner" that performs the equivalent of sub ReturnAndClear { my $temp=$_[0]; $_[0]=undef; return $temp; }; Why would you need that? While you just can simply use like: $val = undef; in the code?