in reply to
RFC: Lexical Fatal.pm for Perl 5.10
What should the module be called?
Should this module even exist? Am I duplicating existing work? Note that I'm using Fatal to do all the heavy lifting internally. To the best of my knowledge there's no existing way to use Fatal with lexical scope.
why not just make this a patch for Fatal triggered by an option on the use line (the option would be implicit for "no" since it's not currently supported and would imply lexicality anyway)?
use Fatal qw(:lexical open close);
open(my $fh, '<', 'some_file'); # Throws exception on failure
no Fatal qw(open);
open(my $other_fh, '<', 'some_other_file'); # fails silent
close($fh); # This still throws an exception.
no Fatal; # Turns off exceptions entirely.
close($other_fh); # Fails silent.
close($yet_another_fh); # Throws exception on failure again.