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

I wrote a module that handles this kinda well. I'm thinking of adding redirection support and all, but I'm dangerously close to reinventing the wheel.
use LWP::FileHandle; lwpopen HOMEPAGE, GET => "http://www.pobox.com/~japhy/" or die "can't access the url: $!" while (<HOMEPAGE>) { print if m!<ul>! .. m!</ul>!; } lwpclose HOMEPAGE;
Get the module at http://www.pobox.com/~japhy/modules/LWP-FileHandle-0.01.tar.gz. Sorry, no documentation in it (yet), but it's self-explanatory, and comes with a test program.

japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Re: Grabbing a web page without LWP or the like
by snax (Hermit) on Nov 22, 2000 at 00:45 UTC
    pssst....bud! The question said something about "without LWP or the like"

    Update:
    FWIW, I did read the code before posting this. I interpreted use URI::Escape as "the like."

    I apologize if this sounded snippy or mean -- it was meant in humor.

      Psst -- the module doesn't use the LWP suite. If you checked the source to the module, you'd see it just uses the standard IO::Socket module. I put it in the LWP namespace because it's similar in function.

      Tsk, tsk. So quick to prejudge...

      japhy -- Perl and Regex Hacker
        Naw, I was looking at "and the like": you import URI::Escape.

        I will admit that your code would be a good place to go hunting to help in another implementation, and the import of URI::Escape highlights some of the issues you need to think about in addressing HTTP negotiations. It wouldn't be that hard to steal the appropriate stuff from that module, I suppose.

        Oh: when I downloaded your .tar.gz, it was just a .tar -- either my browser did a conversion on the fly without changing the extension or you never gzipped your archive.