while (my $line = ) { # do something with $line... # then print it out: print $line; }