my @list = (@values, <$filehandle>); while( my $line = shift @list) { ... my $another_line = shift @list; }