Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Redirection

by blaze (Friar)
on Apr 14, 2003 at 21:50 UTC ( [id://250427]=note: print w/replies, xml ) Need Help??


in reply to Redirection

you could use LWP::Simple to check if its up or not
#!/usr/bin/perl -w use strict; use LWP::Simple; my $website = 'http://www.yahoo.com'; if(head($website)){ #its up } else { #its not }
hth,
Robert

Replies are listed 'Best First'.
Re: Re: Redirection
by Your Mother (Archbishop) on Apr 15, 2003 at 01:37 UTC
    This is a good technique but remember that some hosts do not return head requests at all and others don't return requests made by the generic agent name in LWP::Simple. It's not a long list of hosts but it happens. So, if you're having problems, also try a get() and if that's still not it, try LWP::UserAgent and define your own agent name.

    The previous example is much easier though.

      I have just spoken to my webhoster (im just using Telewest's Advanced Web Service) and they dont have the perl module installed and it doesnt look like they are going to get it installed...is there any way i can use the module code in the actual orginal script, ie merge the two into one .pl script? (i presume there is just with my attempts it came up with a 500 error)
Re: Re: Redirection
by Kedos (Initiate) on Apr 14, 2003 at 22:21 UTC
    thanks that looks pretty easy to use !!! just got work out how to install the modules ?! or is it installed ?! hmm i think ill find that out for myself much more interesting!! thanks again

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://250427]
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: (6)
As of 2024-03-28 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found