[Catalyst] CGI.pm and Catalyst?

Ash Berlin ash_cpan at firemirror.com
Fri Mar 7 10:15:18 GMT 2008


On 7 Mar 2008, at 09:03, Alex Povolotsky wrote:

> Martin Ellison wrote:
>> Is there anything attached to Catalyst similar to the CGI.pm  
>> module? That is, creating the HTML by a series of procedure calls  
>> rather than by instantiating a template?
>>
>> Or is there some way to link up the existing CGI module? $c- 
>> >response->body(ul(li(q{hello}), li(q{world})))) ?
>>
>> Or is it not a good idea?
>>
>> I couldn't find anything from a search, so excuse me please if this  
>> has been covered before.
>
> Creating HTML inside the code is the best way to make unreadable,  
> unmaintainable program with mysterious errors.
>
> Alex.

There's always Template::Declare[0] which lets you do

template simple => sub { html { head {} body { p {'Hello, world wide  
web!'} } } };
And keep the html in a sensible place (i.e. not in your controllers).  
Never used it but i know Jon Rockway has so perhaps he can comment on  
how useful it actually is.

-ash
[0]: http://search.cpan.org/~sartak/Template-Declare-0.28/lib/Template/Declare.pm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080307/dc963fbf/attachment.htm


More information about the Catalyst mailing list