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 = $_; }
In reply to Re^2: How to match previous line
by JavaFan
in thread How to match previous line
by qnguyen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |