open F, "config.txt" or $! !~ /no such file/i or die "config.txt error: $!"; ... process F ...; close F;