in reply to redirecting output in perl
open( LOG, '>>tmp.log'); #open tmp.log for appending print LOG 'hello'; #print hello to LOG file handle
This will print to /var/log/messages in a unix system, using syslogd. This forks off the logging to another process, which prevents your process from blocking on IO.use Sys::Syslog; openlog $0, 'pid', LOG_USER; #prepend progname and pid syslog('warning', "printf formated %s", $string); closelog;
|
|---|