in reply to How to read the last updated lines from a log file
Dear Monks suggest me how i need to parse the log with only last occurrence of of <START>....</START> log contentHow about just reading the log file backwards (see How do I read a file line by line in reverse order (from EOF to start of file)) and stopping when you hit the first <START> (i.e., the beginning of the last log file)? You could capture the lines (in reverse order) in your @logcontent array and then reverse the order (to the proper order) with @logcontent = reverse @logcontent before calling sendmail( $now, \@logcontent );.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to read the last updated lines from a log file
by johngg (Canon) on May 30, 2013 at 11:46 UTC |
In Section
Seekers of Perl Wisdom