Gossamer Forum
Home : General : Perl Programming :

Open a file from a webserver

Quote Reply
Open a file from a webserver
I have recently learned how get my Perl script to open a text file, using something like this;

($INPUT_FILE = "weeds_bgy.txt");

And I can specify a path to the file, such as;

($INPUT_FILE = "textfiles/weeds_bgy.txt");

But what I really want to do is open the file using a URL, such as

($INPUT_FILE = "http://www.domain.com/textfiles/weeds_bgy.txt");

Any help would be appreciated, even to say that's not possible.
Quote Reply
Re: [joematt] Open a file from a webserver In reply to
If you're not worried about being able to save, you can do something like:

Code:
use LWP::Simple;
my $content = get("http://www.gossamer-threads.com/");

print $content;
Quote Reply
Re: [Aki] Open a file from a webserver In reply to
Yes, that works!

Thank you so much.

And no I do not need to save, I just need to grab some text and include it into the page being generated.