in reply to grabbing and printing text

HTML::HeadParser is great at grabbing metadata. Just say no to hand-rolled regex!

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: grabbing and printing text
by Anonymous Monk on May 09, 2001 at 19:36 UTC
    Merlyn, thanks for the tip, but I have no idea how to use a HTML parser, I just started using Perl about a week ago. If you have any tips for how to do this without a parser, I would really appreciate it.
      You are hand-writing a parser. You'll always be "using a parser". It will take you less time to learn to use HTML::HeadParser than it will to study the HTML specifications and learn to write regular expressions that match arbitrary meta-equiv strings correctly. Trust me on that.

      -- Randal L. Schwartz, Perl hacker

      It's a pretty straight-forward module to use--start with the docs from perldoc.com, and if you can't figure it out from there, post what you're having trouble with (though you might first want to read this note, to make sure you're not overlooking something obvious).

      Note that you will have to install the whole HTML::Parser distribution to make any of this work. But it'll still be easier than writing a regex-based parser yourself.



      If God had meant us to fly, he would *never* have give us the railroads.
          --Michael Flanders