use Error::Handler; $rc = func(); if (not $rc->ok()) { die $rc->error_msg(); }