FW: Lynx???

Ovid poec at yahoo.com
Tue Jul 9 16:37:37 CDT 2002

--- Aaron Kilbey <aaronkilbey at hotmail.com> wrote:
> Aloha everybody - 
> I'm attempting to issue an http request through lynx to save an XML file
> to a local server. 
> Here's the code:
> ------------------------------------------------------------------------
> newsdump.pl
> ------------------------------------------------------------------------
> #!/usr/bin/perl
> system("lynx -dump http://www.moreover.com/cgi-local/page?feed=239&o=xml
> > news.xml"); 

A more portable solution:

  use LWP::Simple;
  getstore( $url, $file );

Or better:

  mirror( $url, $file );

You can verify this from the command line:

  perl -MLWP::Simple -e 'getprint("http://www.moreover.com/cgi-local/page?feed=239&o=xml")'

You'll also want to check the is_success() function in that module.

Curtis "Ovid" Poe

"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push at A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift at a;shift at a if $a[$[]eq$[;$_=join q||, at a};print $_,$/for reverse @A

Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free

More information about the Pdx-pm-list mailing list