push adds information at end of a list(array)
-
push(@stack,$new); # is equivalent to @stack = (@stack, $new);
-
One can also use a list for second argument(s) in push as in
-
push(@stack,6,"next",@anotherlist);
|
pop is inverse operator to push and removes the last element in argument as well as returning value of this last element
-
Note chop(@stack) removes last character of each entry of list -- not like pop which removes last entry of list
|
unshift is idential to push except works on left (lowest indices) of list -- not on end of list
|
shift is idential to pop except works on left (lowest indices) of list -- not on end of list
|
reverse(@list) leaves @list unaltered but returns reversed list
|
sort(@list) leaves @list unaltered but returns sorted list
|