THREE: { my @three; push @three, scalar() or last THREE for 1..2; chomp @three; while () { chomp; push @three, $_; print "@three\n"; shift @three; } }