Jumana,
I have never solved the problem to my satisfaction. But this sort of
thing has helped:
$SIG{ALRM} = \&my_catch_alarm;
eval {
ualarm 3_000_000;
$result = $agent->request(HTTP::Request->new(GET => $url));
ualarm 0_000_000;
};
if ($@) {
# We timed out... or something
return;
}
(I am using ualarm rather than alarm because I sometimes need finer
resolution than alarm gives me.)
This alarm does go off sometimes, and works out o.k. for me. But,
in my opinion, it does not ALWAYS go off, and for reasons that I
do not at all understand.
--Jimbo