try { my ($k) = 2; throw sysAssert("test assert"); } catch err with { my ($ex) = @_; print "caught by with\n"; dPrt("warn"," with $ex"); } otherwise { my ($ex) = @_; print "caught by otherwise \n"; dPrt("warn","OTHERWISE:$ex"); } die "got here"; #### otherwise BLOCK Catch any error by executing the code in BLOCK When evaluated BLOCK will be passed one argument, which will be the error being processed. The error will also be available in $@. Only one otherwise block may be specified per try block