But doesn't work if LUN 40 re-triggers
Since he only wants the last one (tail -1), it's easy to fix.
my $target = 0; my $match; while (<>) { $target = $. + 2 if /^LUN 40\s*$/; $match = $_ if $. == $target; } print($match) if defined($match);
In reply to Re^2: trying to do a parse based on starting position.
by ikegami
in thread trying to do a parse based on starting position.
by luckenbach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |