[wplug] web programming
Jonathan Billings
billings at negate.org
Tue Oct 28 10:58:09 EST 2003
On Tue, Oct 28, 2003 at 10:25:13AM -0500, John Harrold wrote:
> something like:
>
> #! /usr/bin/perl
>
> use strict;
> use warnings;
>
> MAIN:
> {
> open my $fh => 'GET http://www.perl.com |' or die "could not open url";
>
>
> while(<$fh>){
>
> print $_;
>
> }
>
>
> exit 0;
> }
>
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.
Jonathan Billings
billings at negate.org
More information about the wplug
mailing list