sub func { ... throw Error::Simple('some message'); } try { func(); } catch Error::Simple with { print "caught something\n"; }