sub x { # stuff eval { # eval-ed stuff }; if ($@) { die $@ unless UNIVERSAL::isa($@, 'ErrorOrSignalThatICanHandleHere'); # Handle the error/signal types I can handle here however I see fit }; return 1; }