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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RFC: Lexical Fatal.pm for Perl 5.10
by pjf (Curate) on Mar 09, 2008 at 08:26 UTC | |
by Smylers (Pilgrim) on Mar 10, 2008 at 11:15 UTC |