package A; sub Y { die "aargh" } sub X { eval { Y }; if ($@) { print "humm... Y failed..." } { print "ok, no error here"; } }