use Try::Tiny qw( try catch ); ... { use feature qw( try ); try { ... } catch ( $e ) { ... } } ...