open F, $file or do { warn "Can't open $file for read $!\n"; exit 1; # Error code for can't open file } do_stuff(*F); close F; exit 0;