in reply to Match on line, read backwards to opening xml tag then forward to closing tag
Cache the part you are interested in
my @cache; my $found=0; while (<$file>) { if ( ... found the match ...) { $found++; } if (/^<DataStart>/) { @cache=(); } push(@cache, $_); if (/^<DataEnd>/ and $found) { Do_stuff_with_match(@cache); $found=0; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Match on line, read backwards to opening xml tag then forward to closing tag
by shadowfox (Beadle) on Nov 14, 2011 at 20:41 UTC | |
by choroba (Cardinal) on Nov 14, 2011 at 23:39 UTC | |
by jethro (Monsignor) on Nov 15, 2011 at 10:32 UTC | |
by shadowfox (Beadle) on Nov 15, 2011 at 13:49 UTC | |
by furry_marmot (Pilgrim) on Nov 16, 2011 at 20:08 UTC |