in reply to Re: trying to do a parse based on starting position.
in thread trying to do a parse based on starting position.
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);
|
|---|