while ( $line = ) { # do stuff to $line } #### #!/usr/bin/perl use strict; use warnings; my @three; # Stoke it chomp ($three[0] = ); chomp ($three[1] = ); while() { chomp ($three[2] = $_); # Do stuff to process @three print join ("\t", @three), "\n"; # Rotate shift(@three); } __DATA__ 1 2 3 4 5 6