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 03:20, 16 July 2012 by AlizaLorenzo (Talk | contribs) (Created page with "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 t...")
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 |