logging errors using perl

Hi,

Can some one please tell me how to redirect only errors to the log file using perl.

Thanks,
Anjan.

---------- Post updated at 08:41 PM ---------- Previous update was at 08:39 PM ----------

Also, i dont want to use any module. Please tell me in normal way

You can capture all the error using below code. It will log all the error in the file test,txt.

open STDERR, ">test.txt" or die "Can't open file for STDERR";