Dylan Stamat wrote:
No, not the routine that deals with Arrays !

I see code like the following, everywhere:
my $coolvariable = shift;

Why is a new scalar being assigned to "shift" ?
New to Perl... sorry for the lame question, but couldn't find an answer
anywhere.

shift is a built-in function. It's documented under

   perldoc -f shift

It removes and returns the first element from an array. When called (as in this case) without an explicit array, it defaults to either @ARGV (if called outside of any sub), or @_ (if called within a sub).

--
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