I would recommend using a very small wrapper program which runs the script, collects any error output, and if it finds any and/or the script exits nonzero, sends the mail. Otherwise there are some situations, like the perl interpreter crashing or running out of memory, that won't generate an email.