Is it possible to use Try::Tiny in a Perl program that has a 'overloaded' $SIG{__DIE__}?
For example, the desired output of this program would be "caught it":
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
use Try::Tiny;
# here how to deal with try and catch
$SIG{__DIE__} =
sub {
print "died my way $_[0]"
};
my $rv;
try {die "its only a flesh wound"; }
catch {
$rv = undef;
print "caught it: $_ ";
};
Thanks for looking and any advice!