Questions about this topic? Sign up to ask in the talk tab.
Perl/Basics/Variables and Data Types/Helper Functions/Shift
From NetSec
Revision as of 00:19, 19 July 2012 by Chantal21I (Talk | contribs) (moved Perl/Basics/Helper Functions/Shift to Perl/Basics/Variables and Data Types/Helper Functions/Shift)
The shift() function is like the inverse of the pop() function and treats the array like a stack. In stead of popping from the top of the stack, this function operates against the bottom of the stack.
my @array = (0,1); my $first_element = shift(@array); # $array[0] now contains one, and @array only contains one element |