That's not quite right; $@ will get the exception (aka "die" message). Anything directly written out to STDERR
STDOUT will not be caught, unless you tie those filehandles (only works for output by perl) or reopen them. If the output is due to a warn, you can catch it with a $SIG{__WARN__} handler.