Perl equivalent of this script?
- From: "george.varsamopoulos@xxxxxxxxx" <george.varsamopoulos@xxxxxxxxx>
- Date: 16 Jul 2006 07:38:43 -0700
I have a collection of perl scripts to manipulate HTML documents and
extract information.
However, i didn't find any short and easy way in Perl to download a
HTML file and save it locally.
For that reason I use the following php script:
<?php
$url = "http://yes.yes.yes/?arg=".$argv[1];
if (($ff = fopen($url, "r"))==NULL) exit();
while (!feof($ff)){
$line = fgets($ff,512);
printf("%s", $line);
}
fclose($ff);
?>
The ease with php is that I can fopen a URL, read it and save it (or
print it to stdout)
like a regular file.
the QUESTION is:
## Is there a short Perl script to replace this PHP script? ##
Any suggestions are welcome
-- George
P.S. I am mainly asking because this is the only part of the script
collection not written in Perl;
using a perl version I could compact the scripts into one.
.
- Follow-Ups:
- Re: Perl equivalent of this script?
- From: Tad McClellan
- Re: Perl equivalent of this script?
- From: A. Sinan Unur
- Re: Perl equivalent of this script?
- Prev by Date: Re: How get UTF-8 from urlencoded web form
- Next by Date: Re: How get UTF-8 from urlencoded web form
- Previous by thread: How to local-ly close a handle?
- Next by thread: Re: Perl equivalent of this script?
- Index(es):
Relevant Pages
|