in reply to Re: Catching DIE no matter what
in thread Catching DIE no matter what
Your app will then exit when 'foo' returns.$SIG{'__DIE__'} = sub { if ($_[0] =~ /matched error text/) { print('Warning - continuing after error: ', $_[0]); goto &foo; } else { print($_[0]); } }; sub foo { print("Continuing in 'foo'...\n"); # Do more work... }
|
|---|