Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

How do I check if a file exists on another (remote) domain?

by CMW (Initiate)
on Sep 17, 2001 at 17:32 UTC ( #112853=perlquestion: print w/replies, xml ) Need Help??

CMW has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to create a script which checks if a site is up or down by checking for a certain file on that domain.

I have tried a few things but as it seems they are all for checking local file and to check for a remote file!

Any suggestions?

Originally posted as a Categorized Question.

  • Comment on How do I check if a file exists on another (remote) domain?

Replies are listed 'Best First'.
Re: How do I check if a file exists on another (remote) domain?
by davorg (Chancellor) on Sep 17, 2001 at 17:52 UTC

    Use LWP::Simple and the head function.

    use LWP::Simple; my $url = 'http://some.server.com/file.html'; if (head($url)) { # file is there } else { # file is missing }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2021-04-21 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?