Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: grabbing previous line in a log

by dimmesdale (Friar)
on Aug 15, 2002 at 14:24 UTC ( [id://190411] : note . print w/replies, xml ) Need Help??


in reply to grabbing previous line in a log

Read through the file keeping track of two lines. I.e., have a $old_line and a $cur_line so that if $cur_line matches, $old_line should be the previous line.