{ use closefail; open my $thing, $what or die "..."; # ... } # <- still in effect as this block ends