> -----Original Message-----
> From: Wim De Hul [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 20, 2001 10:48 AM
> To: [EMAIL PROTECTED]
> Subject: Shift question...
> 
> 
> Hello guys ( and girls),
> 
> While I was reading a script, I saw the lines:
> 
> my $var = shift;
> 
> I thought that shift puts a variable in an array? What does this mean?

Nope, that's unshift().

shift() removes the first element from the array, while unshift()
adds a element at the front of the array. push() and pop() add
and remove an element from the end of the array.

shift() without an array works on @ARGV if outside of a sub, 
or @_ inside a sub.

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

Reply via email to