my @arr = ( 1, 2, 3 ); for my $x ( shift @arr ) { #do some stuff }