Sure. There are a number of ways to accomplish this, depending on your need. I usually redirect STDERR into a scalar - This is discussed in
open (do a page search for redirect). This obviously won't work if you are trying to catch
dies, since you'll just lose the output. This is probably not what you want if this is a long term solution.
Another choice is redefining the __WARN__ and __DIE__ handlers. See error/warn customization for a discussion.
There are also a number of modules on CPAN that might hit your spec. Take a look at the Log namespace, particularly Log::Log4perl.