|go ahead... be a heretic|
Re: Catching perl warnings and errorsby CukiMnstr (Deacon)
|on May 26, 2003 at 08:03 UTC||Need Help??|
Errors and warnings (in UNIX, I don't know how this works in Windows) are printed to STDERR (standard error). STDERR is attached to the console by default, so if you want to print errors/warnings somewhere else, you just have to redirect STDERR (filehandle 2):
to the console, but
will print the error to file ./error.log. Check your shell's manpage for details on redirecting STDERR.
hope this helps,
Update: as for using syslog to log the errors, I don't know if you can do this, since as far as I can remember, you use a specific system call to do that: syslog(3).
Update #2: a quick question in #debian @ freenode.net and I have something else: check the logger command, which is a "shell command interface to the syslog(3) system log module" (from the manpage).