P is for Practical | |
PerlMonks |
Re: print line 5 lines previous to comaprison line!by marcink (Monk) |
on Jun 07, 2001 at 20:57 UTC ( [id://86653]=note: print w/replies, xml ) | Need Help?? |
Hi, this code seems to do the trick quite effectively: while (<>) { $a[$i++%6] = $_; print $a[$i%6] if /match/; } Just change the if condition to something reasonable. -mk
In Section
Seekers of Perl Wisdom
|
|