in reply to Logfile for Error Messages

Well you just want to redirect STDERR to some file. The could do this from the shell of course (unless you're running windows, phew), this way :

$./myscript.pl 2>/some/log/file

of course you can manage it from your script :
open ( STDERR , '>>/some/log/file') or die "Can't open the log file! : $!";
The '>>' sign will append errors to the existing file; '>' will overwrite the previous log.