passing "stderr " to a subroutine..

This is perl, v5.6.1 built for MSWin32-x86-multi-thread
-----------
i thought to pass the stderr to the subroutine which writes in a log file..

when i use
&log_message(\*STDERR);

in the log file instead of the error messages, i am getting only this word

____________::GLOB(0x1ab507c)

and when i use
&log_message(*STDERR);

i got
____________::*main::STDERR

1). i like to know how to pass the error messages into a subroutine(which writes the messages passed to it into a log file..)
2).or how to assign STDERR to a file handle?

thanks in advance..

after some search i got the solution.
for information of others i am replying to my post itself..

i think with system command we cant get the stderr separately.
----------------
Why can't I get the output of a command with system()?
You're confusing the purpose of system() and backticks (``). system() runs a command and returns exit status information (as a 16 bit value: the low 7 bits are the signal the process died from, if any, and the high 8 bits are the actual exit value). Backticks (``) run a command and return what it sent to STDOUT.
----------------
the solution is:
instead of using the system command we have to use backticks(``).

=============
How can I capture STDERR from an external command?
There are three basic ways of running external commands:

system $cmd;		\# using system\(\)
$output = \`$cmd\`;		\# using backticks \(\`\`\)
open \(PIPE, "cmd |"\);	\# using open\(\)With system\(\), both STDOUT and STDERR will go the same place as the script's STDOUT and STDERR, unless the system\(\) command redirects them. Backticks and open\(\) read only the STDOUT of your command

=============
system, backticks, exe--- are the three ways to run commands...
-------
i use this line.."i think" since it might be correct or wrong. i am still learning..
-------
moer details :
http://perldoc.perl.org/perlfaq8.html