FW: Lynx???

Tkil tkil at scrye.com
Tue Jul 9 17:10:24 CDT 2002


>>>>> "Aaron" == Aaron Kilbey <aaronkilbey at hotmail.com> writes:

Aaron> I'm attempting to issue an http request through lynx to save an
Aaron> XML file to a local server. Here's the code:

um... why not just use LWP [http://www.linpro.no/lwp/] ?  either
LWP::Simple::getstore, or the command-line program of the same name:

| $ perl -MLWP::Simple=getstore \
|        -lwe 'getstore "http://www.perl.com/", "perl-com.html"'
| $ ls -al perl-com.html
| -rw-rw-r--    1 tkil     tkil        39697 Jul  9 16:06 perl-com.html

f you're just going to read it in, you can also fetch directly to
memory with "get", from the same package:

| $ perl -MLWP::Simple=get \
|        -lwe 'my $s = get "http://www.perl.com/"; print length $s'
| 39697

if you really must use an external program, consider "wget":

| $ wget -O perl-com-2.html http://www.perl.com/
| --16:08:06--  http://www.perl.com/
|            => `perl-com-2.html'
| Connecting to www.perl.com:80... connected!
| HTTP request sent, awaiting response... 200 OK
| Length: unspecified [text/html]
| 
|     0K .......... .......... .......... ........              @  52.46 KB/s
| 
| 16:08:07 (52.39 KB/s) - `perl-com-2.html' saved [39697]
| 
| $ ls -al perl-com-2.html
| -rw-rw-r--    1 tkil     tkil        39697 Jul  9 16:08 perl-com-2.html

t.
TIMTOWTDI



More information about the Pdx-pm-list mailing list