use Error qw(:try); try { some code; code that might thrown an exception; more code; return; } catch Error with { my $ex = shift; # Get hold of the exception object handle the exception; } finally { cleanup code; }; # <-- Remember the semicolon