You'll have to install it, but
Log::Dispatch will do
this, and much more if you need it to. It's kind of
like syslog in that one log statement can send info to
one or more destinations, each customizable by the log level.
I find
this invaluable when I want to write lots of debug information
to a log
file and at the same time send less information to STDERR
and even less to an email -- without using
3 different print statements.
Speaking of syslog, I've never used Sys::Syslog, which comes with perl.
I have no idea if/how to send stuff to stderr
with it though. Different systems support different
syslog features so yours might allow it. It's probably not worth the
effort of setting it up though, esp if you want portable code.
bluto