On 4/5/07, xavier mas <[EMAIL PROTECTED]> wrote:
HI all,

I am trying to get from a Perl program the source code of a web page and after
to push it into a text file. I'm not able to find to way to do that or even
don't know if that is possible somehow, someway.

Any suggestions?
snip

What you want is LWP::Simple*.  The code looks like this:

#!/usr/bin/perl

use strict;
use LWP::Simple;

my $url = shift;
my $outfile = shift;
my $content = get($url) or
   die "Couldn't get $url!";

open my $out, ">", $outfile
   or die "Could not open $outfile: $!";

print $out $content;

* http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP/Simple.pm

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to