my @ary = qw(a b c d e f g); @_ = @ary; while (my ($one,$two) = (shift @_, shift @_)) { print "$one $two\n"; last unless defined $two; }