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.
In reply to Re: RFC: Lexical Fatal.pm for Perl 5.10
by hossman
in thread RFC: Lexical Fatal.pm for Perl 5.10
by pjf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |