Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by davorg (Chancellor)
on Sep 17, 2001 at 17:52 UTC ( #112857=categorized answer: print w/replies, xml ) Need Help??

Q&A > files > How do I check if a file exists on another (remote) domain? - Answer 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?
[holli]: or "ignorant bricks" (that is not a typo)
[choroba]: holli The money wasn't bad :-)
[choroba]: Discipulus Try changing the URL constants to something else

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2017-10-24 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (289 votes). Check out past polls.

    Notices?