in reply to Pushing arrays around inside a loop ;-)
#!/usr/bin/perl -w use strict; my @array = qw/v w x y z/; for(1 .. 5) { # I was expecting the array to shift # at every loop, and I could call on # the first position every time. print $array[0] , "\n"; my $slide = shift(@array); push(@array, $slide); }
|
|---|