my $status = catch { my $result; my $ottoStatus = catch {$result = otto()}; doSomethingWith($ottoStatus) if $ottoStatus; error("Wrong number of otto\n") unless $result == 4; doAnything(); }; doSomethingWith($status) if $status;