Mark Stosberghttp://cpanratings.perl.org/dist/Template-Extract#2078
Rating: 3 stars
This scraping tool is to nice to have in the toolbox, but's no substitute for a deeper understanding of Perl REs. Having been a convenient solution in the past, today Template::Extract fell flat on its face when I tried to use it. Even with the DEBUG option turned on, it just churned for a long time with no useful result.
Accomplishing the same task using regular pattern matching turned out to be simple to write:
my @custs;
while ($html =~ m{/custs.cgi\?id=(\d+)'.*?(PROSPECT|LEAD)-(.*?)\s*</td>}gs) {
push @custs, {
cust_id => $1,
stage => $2,
status => $3,
};
}
And it ran noticeably faster! Having compared both styles, sometimes the "old fashioned" way turns out to be simpler and clearer.
But yes, Template::Extract is certainly a neat idea and fun to play with.Mark Stosbergvdmhttp://cpanratings.perl.org/dist/Template-Extract#338
Rating: 5 stars
Great idea, brilliantly executed. Given a template and a string, this module gives you the data out of the string. So you can write a parser for a string (a web page, say) by writing the template that *would* generate it.
NTK raved about this: http://www.ntk.net/2003/09/12/
See also Template::Generate by the same author, which given some data and a string, gives you the template that would generate the string.vdmAdrian Howardhttp://cpanratings.perl.org/dist/Template-Extract#252
Rating: 5 stars
Very nice tool for generating simple parsers / screen scrapers. You write a template toolkit template that would generate your content (using a subset of TT commands) and Template::Extract does the rest.
Most funky.
Adrian Howardsimonhttp://cpanratings.perl.org/dist/Template-Extract#251
Rating: 5 stars
Was OurNet::Template, now Template::Extract. Easily my favourite module of the year. Makes parsing anything a doddle.simon