in reply to Re^6: Perl try { } catch(e) { }
in thread Perl try { } catch(e) { }
Anyway, try it, and you will see it is quite stable, but if you have any suggestion for improvement, I would very much welcome it.
Yes, sorry, I wasn't doubting the quality of the implementation of Nice::Try. Though PPI is certainly excellent, like all static Perl parsers it can't actually parse all of Perl. Sadly, all source filters suffer from the fact that they can be broken by things outside of their control, namely, the source code that they are inserted into.
With Perl 5.34:
use warnings; use strict; use experimental 'try'; print foo(); # prints "Caught an error: Argh..." sub foo { try { die( "Argh...\n" ); } catch( $wow ) { return( "Caught an error: $wow" ); } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Perl try { } catch(e) { }
by jdeguest (Beadle) on Jun 18, 2021 at 11:53 UTC |