# rotate @array left my $temp=shift @array; push(@array,$temp); # rotate @array right my $temp=pop @array; unshift(@array,$temp);