473,379 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

help on LWP::Parallel

Is there anyway can make my script continue to run? If I just run 1st
and 2nd or 1st and 3rd in the request list, the script won't be
terminated, but it will be broken when list contains both 2nd and 3rd
URLs.

#!/usr/bin/perl -w
require LWP::Parallel::UserAgent;
use HTTP::Request;

# display tons of debugging messages. See 'perldoc LWP::Debug'
#use LWP::Debug qw(+);

# shortcut for demo URLs

my $reqs = [
HTTP::Request->new('GET', 'http://www.yahoo.com'),
HTTP::Request->new('GET', 'http://www.oceanestatesa.com'),
HTTP::Request->new('GET',
'http://www.oceanstatenautical.com'),
];

my $pua = LWP::Parallel::UserAgent->new();
$pua->in_order (1); # handle requests in order of
registration
$pua->duplicates(0); # ignore duplicates
$pua->timeout (2); # in seconds
$pua->redirect (1); # follow redirects

foreach my $req (@$reqs) {
print "Registering '".$req->url."'\n";
if ( my $res = $pua->register ($req) ) {
print STDERR $res->error_as_HTML;
}
}
my $entries = $pua->wait();

foreach (keys %$entries) {
my $res = $entries->{$_}->response;

print "Answer for '",$res->request->url, "' was \t",
$res->code,": ",
$res->message,"\n";
}

Thnaks.
J.

Jul 19 '05 #1
0 3865

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Joe | last post by:
I need to connect to 10 web sites to grab content from them. I would like to connect to each site simultaneously so that I can obtain the data as fast as possible. I am familar doing this with...
10
by: Joshua Nussbaum | last post by:
I came up with what I think is a good idea for making multithreading programming easier in any .NET language. I dont know where else to post it, so I'll try here. ..NET 2.0 adds the capability...
10
by: Ruben Hoste | last post by:
Hello, I'm currently looking for more information on Genetic Algorithms and more specifficaly on how to program them in Java or C++. This is all concerning my thesis. A lot of general information...
9
by: MNQ | last post by:
Hi All I want to use my parallel port of my PC to control some external devices. I am writing a program in ANSI C using the PacificC compiler. What I need to know is how to access the parallel...
2
by: Carlos Pezzotta | last post by:
Hi guys, I have to develop an application to capture the "printed" data from another machine. I have a specialized hardware (not a computer) that has only a parallel port (Centronics-SPP)...
12
by: david.brown.0 | last post by:
I'm trying to make a Java program access a parallel port. Java's comm API does not provide me with the control I need. I need to be able to write to the data and control pins and read the status...
4
by: Soren | last post by:
Hi, I want to control some motors using the parallel port.. however, my laptop does not have any parallel ports (very few do). What I do have is a USB->Parallel converter... I thought about...
0
by: faztech | last post by:
Hello, I appreciate if you guys can help me clarifying the proper setup for my proposed development project that may be using parallel to serial/usb converter. Please see this image before I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.