[wplug] web programming
John Harrold
jmh17 at pitt.edu
Tue Oct 28 11:01:40 EST 2003
Sometime in October Jonathan Billings assaulted the keyboard and produced:
| I see this and kind of go 'ew'. Perl has it's own native web-reading
| capabilities, what you are doing is forking a shell which is running
| another perl process to read a web page! GET is part of the LWP package,
| which provides some simply ways of getting a web page.
|
| I guess I'm just whining because it seems so strange to fork off two
| other processes to do what perl can do itself, albeit with more
| complexity.
yeah, my initial thought was something like this:
#! /usr/bin/perl
use strict;
use warnings;
use LWP;
MAIN:
{
my $ua = LWP::UserAgent->new;
my $url = 'http://www.perl.com';
my $req = HTTP::Request->new(GET => $url);
my $res = $ua->request($req);
print $res->content;
exit 0;
}
but he said he wanted to do it with open.
--
--------------------------------------------------------------------------
| /"\
john harrold | \ / ASCII ribbon campaign
jmh at member.fsf.org | X against HTML mail
the most useful idiot | / \
--------------------------------------------------------------------------
What difference does it make to the dead, the orphans, and the homeless,
whether the mad destruction is brought under the name of totalitarianism or
the holy name of liberty and democracy?
--Gandhi
--------------------------------------------------------------------------
gpg --keyserver keys.indymedia.org --recv-key F65A739E
--------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://penguin.wplug.org/pipermail/wplug/attachments/20031028/0082c081/attachment-0001.bin
More information about the wplug
mailing list