in reply to Fetching HTML Pages with Sockets

I just thought I would mention this...

LWP::Simple is a pure-Perl module, with only one dependency: HTTP::Status. That too is a pure-Perl module, with no dependencies. So both could be installed to a ~/lib path within your own user path, without sysadmin intervention, and without tricky compilation steps. It's pretty easy.

After installing them, you would only need to adjust @INC so that perl can find where you've put those modules.

Doing so would allow you to get pages via HTTP as easily as "my $page = get('http://www.perlmonks.org');."


Dave

Replies are listed 'Best First'.
Re^2: Fetching HTML Pages with Sockets
by JamesNC (Chaplain) on Sep 20, 2004 at 11:24 UTC
    I would also add that Win32 Perl installations have "get.bat" in the /Perl/bin dir so you can "get" pages from the command line or you can write simple one liners to fetch one or many pages or binaries :-)
    perl -le "`get http://www.perlmonks.com/index.pl?parent=392273;node_id +=3333 > node_$_.htm` for qw /3333/;"

    This example fetches this node and the one above it.
    JamesNC