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