#! /usr/bin/perl use Try::Tiny; my $res = try { print "point 1\n"; die "point 1.5\n"; 11; } catch { print "point 2\n"; die "point 2.4\n"; 22; } finally { print "point 3\n"; die "point 3.5\n"; 77; }; print "res $res\n"; #### point 1 point 2 point 2.4 point 3 #### #! /usr/bin/perl use Try::Tiny; my $res = try { print "point 1\n"; die "point 1.5\n"; 11; } catch { print "point 2\n"; 22; } finally { print "point 3\n"; die "point 3.5\n"; print "point 3.8\n"; 77; }; #### point 1 point 2 point 3 res 22