open my $fh, '<', $file or die "can not open $file: $!"; while <$fh> { ... }