develooper Front page | perl.beginners | Postings from February 2012

Re: how to understand shift?

Thread Previous | Thread Next
From:
Jim Gibson
Date:
February 7, 2012 08:40
Subject:
Re: how to understand shift?
Message ID:
p06240801cb57045276d1@[192.168.1.3]
At 3:19 PM +0800 2/7/12, Jeff Peng wrote:
>òƒ 2012-2-7 15:07, lina é ì¼:
>>	my $month = shift ;
>>	my $year = shift ;  ######## here after shift the $year becomes null?
>>http://perldoc.perl.org/functions/shift.html
>
>
>after shift the @_ becomes null. $year is 2007.

To be precise, @_ becomes empty, not null.

--
Jim Gibson
Jim@Gibson.org

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About