Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Open .txt file on remote domain

by ced4dad (Initiate)
on Oct 27, 2012 at 23:16 UTC ( #1001236=perlquestion: print w/ replies, xml ) Need Help??
ced4dad has asked for the wisdom of the Perl Monks concerning the following question:

Gentlemen: I would like to host a data .txt file in the HTML area of my domain that contains ONLY a version number or designator in a string. I would like for users of some of my scripts to be able to open that file, read only, within the script, to see if there is a newer version available. While it is a normal thing to open such a data file locally on the domain running the script, is there a way to cross domains to open a file for this purpose?

Comment on Open .txt file on remote domain
Replies are listed 'Best First'.
Re: Open .txt file on remote domain
by choroba (Canon) on Oct 27, 2012 at 23:34 UTC
    See LWP::Simple.
    use LWP::Simple; my $content = get("http://www.mydomain.net/file.txt");
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      Thank you very much for the help. Seemed to work fine with very little overhead.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1001236]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-08-05 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (80 votes), past polls