in reply to Re: How to match previous line
in thread How to match previous line
If "BEEP" is on the first line, it just prints nothing. Which is the same effect as not printing (assuming no assignment to $\ has been done).my $previous = ""; while (<$handle>) { print $previous if /BEEP/; $previous = $_; }
|
|---|