have BEGIN { open (STDOUT, '>>/some/log/file') } if you want it to file
otherwise do, open (STDOUT, "<&STDERR"); and with shellstuff, > redirects stdout, 2> redirects stderr so system ("ls /apa >/dev/null 2>&1"); redirects both outputs to /dev/null is that what you wanted? /Jon Alex Harris wrote: > > The program I'm writing is going to run under a cron job. Therefore its > important that I catch all exceptions in a file and not have them return to > the command line. > > For instance the following: > (system("ls *.r > $plantfile") > raises this exception at times: > ls: 0653-341 The file *.r does not exist. > > What I want to happen is for that exception and its message to appear in a > file, not the prompt line, AND for the program to continue on. > > Also, there are times where a certain exception will need to kill the > program, but when I do a 'die' I also need it to be written to a file and > NOT the command line. > > How do I accomplish these two things? > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]