L
Leif Wessman
Hi!
I'm using LWP:arallel to create several parallel requests. I would
like to handle the result from each reqest as it come. So, I've
registered a callback function to the user agent, like this:
my $res = $ua->register($req, \&callback);
In the callback function I would like to use a regular expression that
matches 9 digits. This is what I have:
sub callback {
my($chunk,$response,$protocol) = @_;
$chunk =~ /(\d{9})/;
...
}
What I wonder is what happens if I get a chunk that ends with "12345",
and the next chunk starts with "6789". Will it get matched? If not,
how can I change my code so it matches "123456789" even if it's in two
different chunks?
Thanks for any input.
Leif
I'm using LWP:arallel to create several parallel requests. I would
like to handle the result from each reqest as it come. So, I've
registered a callback function to the user agent, like this:
my $res = $ua->register($req, \&callback);
In the callback function I would like to use a regular expression that
matches 9 digits. This is what I have:
sub callback {
my($chunk,$response,$protocol) = @_;
$chunk =~ /(\d{9})/;
...
}
What I wonder is what happens if I get a chunk that ends with "12345",
and the next chunk starts with "6789". Will it get matched? If not,
how can I change my code so it matches "123456789" even if it's in two
different chunks?
Thanks for any input.
Leif