while (my $line = <>) { # do something with the line }