in reply to Grabbing a web page without LWP or the like
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.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>;
|
|---|
| 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 |