G
george.varsamopoulos
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.
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.