in reply to grab only if pattern matches previous line
Untested, but maybe a hint to a better solution :)
my $matched = 0; my $blah1; foreach (@lines) { if (m/^request\(.+$/) { $blah1 = $1; matched = 1; next; } if (m/^s+START_TIME,(.+)$/ && $matched) { print $blah1,':',$1; } $matched = 0; }
regards,
tomte
Hlade's Law:
If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.
|
|---|