Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does -e work with IP addresses?

Status
Not open for further replies.

AndyGroom

Programmer
Joined
May 23, 2001
Messages
972
Location
GB
I'm not really a perl programmer so forgive my ignorance!

I wrote this code, and it works:

Code:
if (-e "../$logid/$celebid$imageDIMS$trans" . ".jpg")

I then changed it to this:
Code:
if (-e "$imageserver/$logid/$celebid$imageDIMS$trans" . ".jpg")

where $imageserver is one of 3 servers specified by IP address, eg:

Code:
$imageserver = "[URL unfurl="true"]http://111.222.333.444";[/URL]

I'm guessing it doesn't work because -e only works with local files and can't look onto a different server?

Is there a solution so that I can do what I want to do?

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Short answer: no, "-e" won't work for URLs.

You could use the "head" function of the LWP::Simple module to see if it's possible to fetch a file over HTTP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top