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 }