Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

( #112857=categorized answer: print w/ replies, xml ) Need Help??

Q&A > files > How do I check if a file exists on another (remote) domain? contributed by davorg

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 }

Comment on Answer: How do I check if a file exists on another (remote) domain?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2015-08-01 01:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls