Reading flat file server to server

Is there a way to  read a single flat file from CGIs on different servers?
I have tried open(DATA_FILE, http://www.domain.com/over_there/my_list.txt) || &die(cannot open!) ;  and it wont read, even with 0666.  
budginAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GnissmanCommented:
To retrieve a file from another server you should use the UserAgent (from libwww)

So your code would look like this:
-----------------------------------------------------------
# use libwww
use LWP::UserAgent;

# create new UserAgent object
$ua = LWP::UserAgent->new();

# create new HHTP-Request object
$request = HTTP::Request->new('GET','http://www.domain.com/over_there/my_list.txt');

# retrieve the Respone-object
$response = $ua->request($request);

# store content of my_list.txt to $document
$dokument = $response->content();
-----------------------------------------------------------

Still quite simple, isn't it? :o)

HTH,
Gniss
0
prakashk021799Commented:
How about simpler? :-)
Use the module appropriately named LWP::Simple.


use LWP::Simple;

$file = get('http://www.domain.com/over_there/my_list.txt')
            or die "can't get page.\n";


0
budginAuthor Commented:
I'm sorry, my knowledge, <em>at this time</em>, is fragmented. After that, do I proceed to: open(HANDLE, "$file") ? ......Thanks  
0
prakashk021799Commented:
No. The content of the web page is retrieved and saved in the variable $file. Perhaps I should have used a different name for the variable.

All you have to do is to process the data.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
budginAuthor Commented:
I'm a happy camper.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.