use strict; use warnings; use Data::Dumper; my @a = ( 1, 2 ); my $x; my @b; while( @b = ( $x ) = shift @a ) { print Dumper \@b; }