Eradicatore has asked for the wisdom of the Perl Monks concerning the following question:
So you can run this program as is, and if you type in something like "http://www.yahoo.com" and enter it will go get that page and put it in a file. But how would the original program that started this program send it things. Thanks for any help!!#!/usr/local/bin/perl -w use LWP::UserAgent; use URI::URL; my $ua = LWP::UserAgent->new; while($line = <STDIN>) { chomp($line); if ($line =~ /now_done/) { last; } else { $url = $line; $file = 'some_web_page.txt'; my $req = HTTP::Request->new(GET => $url); $req->header('Accept' => 'text/html'); $ua->request($req, $file); } }; print "done now\n"; exit;
Justin Eltoft
"If at all god's gaze upon us falls, its with a mischievous grin, look at him" -- Dave Matthews
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Win32::Process and Sockets
by CubicSpline (Friar) on Sep 25, 2001 at 21:40 UTC | |
by Eradicatore (Monk) on Sep 25, 2001 at 22:23 UTC | |
(tye)Re: Win32::Process and Sockets
by tye (Sage) on Sep 25, 2001 at 21:51 UTC | |
Re: Win32::Process and Sockets
by idnopheq (Chaplain) on Sep 25, 2001 at 22:25 UTC | |
Re: Win32::Process and Sockets
by Rex(Wrecks) (Curate) on Sep 25, 2001 at 22:33 UTC |