in reply to Re^3: Breaking The Rules II
in thread Breaking The Rules II
Parsing HTML with a parser:
"...far quicker to use a 'bunch of regex' to extract the data I want... ...when things change, I find it easier to adjust the regex than figure out which other module or modules and methods I now require. ... I think that there is an element of 'laziness gone to far'...".No!
Really, how much real world HTML have you had to deal with? Some monks do indeed argue that "you can parse HTML with a regex" (e.g. tye) but I've never seen any argue against using a parser. Most monks urge that a parser be at least considered.
As with other aspects of Perl where there are many ways to do it, you tend to settle on what you're most comfortable with. So, naturally, monks will have different favorites. Mine is HTML::TokeParser::Simple, a wonderful module. :-)
But there's more!
Mostly, take the time to learn to use regex well and you'll not need to run off to cpan to grab, and spend time learning to use, one of ten new modules, each of which purport to do what you need, but each of which has its own set of limitations and caveats.Replace the word 'regex' with 'Perl' and you'll have encompassed all of cpan. What cpan modules do you use? If you took the time to learn perl well you'll not need to. And I say that with no limitations or caveats. :-)
p.s.
could you kindly leave my gums out of this.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Breaking The Rules II (regex HTML)
by tye (Sage) on Jul 03, 2007 at 21:38 UTC | |
Re^5: Breaking The Rules II
by BrowserUk (Patriarch) on Jul 03, 2007 at 21:18 UTC | |
by wfsp (Abbot) on Jul 04, 2007 at 08:43 UTC |
In Section
Meditations