<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On 7 Mar 2008, at 09:03, Alex Povolotsky wrote:</div><div><br class="Apple-interchange-newline"><blockquote type="cite">Martin Ellison wrote:<br><blockquote type="cite">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?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Or is there some way to link up the existing CGI module? $c-&gt;response-&gt;body(ul(li(q{hello}), li(q{world})))) ?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Or is it not a good idea?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I couldn't find anything from a search, so excuse me please if this has been covered before.<br></blockquote><br>Creating HTML inside the code is the best way to make unreadable, unmaintainable program with mysterious errors.<br><br>Alex.<br></blockquote></div><br><div>There's always Template::Declare[0]&nbsp;which lets you do&nbsp;</div><div><pre><font class="Apple-style-span" color="#000000" face="Helvetica" size="3"><span class="Apple-style-span" style="white-space: normal; background-color: transparent; font-size: 12px;"><br>    template simple =&gt; sub {&nbsp;html {
            head {}
            body {
                p {'Hello, world wide web!'}
            }
        }
    };</span></font></pre><pre><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; white-space: normal;">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.</span></font></pre><pre><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; white-space: normal;"><br class="webkit-block-placeholder"></span></font></pre><pre><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; white-space: normal;">-ash</span></font></pre><pre><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; white-space: normal;">[0]:&nbsp;<span class="Apple-style-span" style="font-size: 13px; "><a href="http://search.cpan.org/~sartak/Template-Declare-0.28/lib/Template/Declare.pm">http://search.cpan.org/~sartak/Template-Declare-0.28/lib/Template/Declare.pm</a></span></span></font></pre></div></body></html>