open my $fh, '<', $filename or die "open('$filename'): $!"; while (<$fh>) { # Do whatever you want with the line in $_ } close $fh;