Template Toolkit Reverse

lorn on 2008-02-05T03:05:52

Well, i need to developer some spiders and sometimes it's so tired to parse html ( HTML::TreeBuilder for that ) then, i was thinking "Why i did not write a 'reverse' Template Toolkit?"

Just because i had a original idea, somebody thought before...

My co-worker found at CPAN the Template::Extract that did exactly what i need :)


Re: Template Toolkit Reverse

davorg on 2008-02-05T09:45:56

In training courses about templating (and TT in particular) I think of it like this:

  • Data + Template = Output (use Template)
  • Output - Template = Data (use Template::Extract)
  • Output - Data = Template (use Template::Generate)

Given two items from the equation (Template, Data, Output) you can calculate the third.

However, the last time I looked neither Template::Extract nor Template::Generate support the full TT syntax.