in reply to Grabbing a web page without LWP or the like

Why not:
use IO::Socket; # distributed with Perl my $web = new IO::Socket::INET("www.example.com:80") or die "Couldn't connect: $@"; print $web "GET /some/file HTTP/1.0\n"; print $web "Host: www.example.com\n\n"; $/=''; my $results = <$web>;
Now just parse out the headers, look for errors, etc. This will not follow redirects (e.g. "/some/directory" -> "/some/directory/"), and is generally only usable for the most basic case of web requests. If you want any real abilities outside of this, you'd be far better off using LWP, or at least reading through it and pulling out the code that you need.

Replies are listed 'Best First'.
Re: Re: Grabbing a web page without LWP or the like
by Hot Pastrami (Monk) on Nov 21, 2000 at 23:53 UTC
    Oh, that's beautiful... thank you. This is a good indication that I really need to get to know IO::Socket better.

    Alan "Hot Pastrami" Bellows
    -Sitting calmly with scissors-