|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: Save 2 files' diff as 3rd fileby Zaxo (Archbishop) |
| on Mar 03, 2002 at 18:37 UTC ( #149004=note: print w/ replies, xml ) | Need Help?? |
|
Here's a version. It's not a general diff, but relies on the error log to contain everything to be rejected. There is dependency on both logs having error messages in the same order. That's reasonable, but may not be guaranteed. If more than one server is logging, there would be a problem. We go through the error log one line at a time. For each line, we look forward in the all-log until we find it, by diamond op and $/ magic. We delete the matched error line with chomp and print to the new log extract file. When done with errors, we tack on the rest of the log. Untested, but it should work. Update: Added a more graceful failure mode if an error line is missing. After Compline,
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||