in reply to $@ can't be relied on?
Take a look at a source of a neat module Try::Tiny, which has "safe eval"-ing as the only goal. Can be used as a replacement of own eval-s. Does more or less what other respondents wrote, plus localizing $@.