use Error; try { scrub($decks); weigh($anchor); sail_to($destination); } catch Error::Anchor with { my $E = shift; warn "The anchor's stuck due to $E"; } otherwise { my $E = shift; warn "We're not sailing due to $E"; };