while (my $line = <>) { # do someting with $line which was \n # terminated. (or in Windows \r\n terminated) # Perl figures that difference out for you. }