shift Operator:
@array=qw # abc def ghi #;
$element_1=shift(@array); #gets abc
$element_2=shift @array; #gets def
unshift Operator:
unshift (@array, zyx); # @array has zyx abc
unshift @array, wvu; # @array has wvu zyx abd
@other_array=1..5; # has 1 2 3 4 5
unshift @array, @other_array; #@array now has 1 2 3 4 5 wvu zyx abd
No comments:
Post a Comment