It shows that you are unregistered. Please register with us by clicking Here
![]() |
|
![]() |
![]() | Register - FAQ - Today's Posts - New Posts - Support - Search | ![]() |
![]() |
![]() |
|
LinkBack | Thread Tools | Display Modes | ![]() |
|
|
#1 (permalink) |
|
Member
Join Date: Jun 2006
Age: 33
Posts: 34
|
Hi there!
I'm writing my first perl code and would like to have my program's result to a file. I'm handling errors like this: ... else { die "file is not valid at line $Num! "; } How can I write this error to a (log)file before my program dies? Should I use this in each case when I have die{} ? else { open ($LOG_FILE_HANDLE, ">mylog.log" ) || die "main() : mylog.log" ; print $LOG_FILE_HANDLE "Error: file is not valid at line $Num!"; close( $LOG_FILE_HANDLE) ; Or is there a professional solution for this? Another question is, that if my program is running, and for some reason it terminates / hangs (because of interruption, resetting computer due to power-cut, shut down..etc) how can I write to a logfile that a failure occured and the program was terminated? I'm using logfile handling as above. Thanks samuel |
|
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Writing Services | articlewriter | Services | 12 | 05-30-2007 11:27 AM |
| Content Writing Service. | kibeth | Content | 4 | 03-23-2007 07:00 PM |
| Writing Services | kconnections | General Business Issues | 4 | 10-04-2006 05:25 PM |
| What HTTP error is generated when there is an error in an ASP page? | agaba175 | ASP | 0 | 08-05-2006 08:25 PM |
| Writing Off My Car for Tax? | jordan | General Business Issues | 6 | 07-31-2006 11:06 PM |