L
Lydia Shawn
hi,
i need someones good advice solving the following problem:
i am matching a html page for certain triggers and want to grep only
the text in between two triggers.
as soon as the last trigger has been matched, the html page should not
be downloaded any further
here is what i got, which works well, but it requires the entire html
page do be downloaded before it starts matching:
input: test.htm
bla1
trigger1 bla2 trigger2
bla3
output:
bla2
assuming bla3 is a long text, i do not wish to was bandwith
downloading it, if the match has already been found.
the script i wrote:
require 5.004;
use LWP::Simple;
$return = get("http://test/test.htm");
$before = 'trigger1';
$after = 'trigger2';
($match) = $return =~ /$before(.*?)$after/si;
print $match;
is there a way i can combine the get command with something like
"until match = anything" ?
any help would be greatly appreciated!
thanks in advance!
lydia
i need someones good advice solving the following problem:
i am matching a html page for certain triggers and want to grep only
the text in between two triggers.
as soon as the last trigger has been matched, the html page should not
be downloaded any further
here is what i got, which works well, but it requires the entire html
page do be downloaded before it starts matching:
input: test.htm
bla1
trigger1 bla2 trigger2
bla3
output:
bla2
assuming bla3 is a long text, i do not wish to was bandwith
downloading it, if the match has already been found.
the script i wrote:
require 5.004;
use LWP::Simple;
$return = get("http://test/test.htm");
$before = 'trigger1';
$after = 'trigger2';
($match) = $return =~ /$before(.*?)$after/si;
print $match;
is there a way i can combine the get command with something like
"until match = anything" ?
any help would be greatly appreciated!
thanks in advance!
lydia