develooper Front page | perl.beginners | Postings from January 2002

catching an exception before it reaches command line

Thread Next
From:
Alex Harris
Date:
January 17, 2002 08:16
Subject:
catching an exception before it reaches command line
Message ID:
F209IK7DvQSPCgbaOJH00007b4a@hotmail.com

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


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About