Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: How do I tell if a remote site is up?

by Elliott (Pilgrim)
on Nov 11, 2003 at 18:21 UTC ( [id://306305]=note: print w/replies, xml ) Need Help??


in reply to Re: How do I tell if a remote site is up?
in thread How do I tell if a remote site is up?

Sounds great - now what am I doing wrong?

#!/usr/bin/perl use LWP::Simple; print "Content-type: text/html\n\n<html><body bgcolor=white>\n"; local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required eval { alarm 4; $content = get("http://select.worldpay.com/wcc/info?op=rates&instI +d=36128"); alarm 0; }; if ($@) { die unless $@ eq "alarm\n"; # propagate unexpected errors # timed out print "timed out<BR>"; } else { # didn't print "succeeded<BR>"; } if($content) { print $content; } else { print "Durrr"; }

It's still hanging.

I haven't really understood how to use SIGALARM - I am just coding-by-numbers at the moment hoping that understanding will dawn.

Replies are listed 'Best First'.
Re: Re: Re: How do I tell if a remote site is up?
by Elliott (Pilgrim) on Nov 11, 2003 at 19:35 UTC
    Ah.. I've tried it on a different server and it works perfectly. I wonder what the difference is.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://306305]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-23 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found