--- "Brett W. McCoy" <[EMAIL PROTECTED]> wrote:
> On Wed, 20 Feb 2002, Nestor Florez wrote:
> 
> > I was wondering about the "shift" inside a subroutine.
> >
> > I have never used it.  What is the purpose of it been there?
> 
> It pulls off the first element of the array passed to it.  Using shift
> with no arguments always pulls from @_

Brett,

Great description with one minor caveat:  shift with no arguments will pull from @ARGV 
if not used
in a subroutine.

Cheers,
Curtis "Ovid" Poe

=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to