LWP::Parallel how to process results

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I am using LWP::Parallel::UserAgent

I register requests, and $pua->wait() returns a hash ref, the keys are the
stringified registered requests (HTTP::Requests).

Since I want each result to have it's own handler, I currently make a look
up table (hash) with stringified request object ref as key and a ref to a
sub as value, and do something like:

for my $key ( keys %$entries ) {

      my $response = $entries->->response;

        my $callback = $key2callback{ $key };
        $callback->( $response->content );

Is there a more clean approach?

John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html

Site Timeline