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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading contents of a file on a server

Status
Not open for further replies.

mgeurts

Programmer
Apr 30, 2002
13
US
I would like to have a group of files on a server, and then have perl (on another computer) read those files, and append to them. The two computers will not be on a network, so the transfer will have to be over the internet. What would be the best module/commands to use?

Thanks,
Mark
 
You could use ftp to transfer the files to the local computer and then read them, or you could write a "cgi" on the remote computer to do the file handling and pass back whatever you need to the local program, then use the LWP module to call the remote "cgi" program. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
An alternative to Tracy's approach would be to use the Net::FTP module.

Net::FTP would allow you to get, put and append to files fairly easily. Mike
________________________________________________________________________________

"Experience is the comb that Nature gives us, after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
Actually, that's what I meant by using ftp, although you could execute ftp using the system command and a script file.

Mike, does the Net::FTP module allow you to actually read the file, or just copy it to the local computer? Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Tracy,

Sorry - I didn't read your reply properly, I just saw the stuff about LWP etc and thought - I'll bung a comment in re Net::FTP.

And no, it doesn't let you read the file, you have to xfer the file to the local machine and read it there....

*not* one of my better replies that, sorry everybody Mike
________________________________________________________________________________

"Experience is the comb that Nature gives us, after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top