armenica has asked for the wisdom of the Perl Monks concerning the following question:
Hi!
Is there a simple way to open a handle to an URL and read the replied content? I would like to convert the following PHP code to PERL, but can't quite find a function which could do the same:
//Specify your URL $URL = "http://www.exampleurl.com"; //Open a stream in READ mode $handle = fopen ($URL, "r"); //Read the content of the URL and manipulate it. $key = str_replace(' ', '%20',fread($handle, 1000000));
It's the openning of the URL-stream and how to read it I would like to know.
Thanks in advance,
/V
Edit: g0n - code tags and formatting
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how to read data from a URL
by Tomte (Priest) on May 15, 2007 at 07:55 UTC | |
by xhunter (Sexton) on May 15, 2007 at 23:29 UTC | |
Re: how to read data from a URL
by Mutant (Priest) on May 15, 2007 at 08:19 UTC | |
Re: how to read data from a URL
by bart (Canon) on May 15, 2007 at 10:02 UTC | |
by clinton (Priest) on May 15, 2007 at 10:22 UTC | |
by Corion (Patriarch) on May 15, 2007 at 10:42 UTC | |
by Mutant (Priest) on May 15, 2007 at 11:04 UTC | |
by Corion (Patriarch) on May 15, 2007 at 11:06 UTC | |
by derby (Abbot) on May 15, 2007 at 14:14 UTC | |
| |
by clinton (Priest) on May 15, 2007 at 10:47 UTC | |
Re: how to read data from a URL
by mantra2006 (Hermit) on May 15, 2007 at 13:03 UTC | |
by Anonymous Monk on Mar 11, 2017 at 16:11 UTC | |
Re: how to read data from a URL
by AK108 (Friar) on May 15, 2007 at 15:49 UTC | |
Re: how to read data from a URL
by faraco (Acolyte) on Mar 12, 2017 at 06:31 UTC |
Back to
Seekers of Perl Wisdom