Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: RFC: Template::YetAnother

by Zaxo (Archbishop)
on Nov 15, 2002 at 23:18 UTC ( #213307=note: print w/replies, xml ) Need Help??


in reply to RFC: Template::YetAnother

I ++ed this for the work and thought you've put into aiming before shooting. I regret that I think you missed anyhow.

Looking at your coded $data, that doesn't seem much different in concept from the html generation available from CGI.pm. You still have much of the content firmly embedded in perl.

I don't see what's gained by (somewhat inaccurately) calling an iterative loop 'recursion' and shoveling it back into the program logic under a fig leaf of a template label. Similarly with decision structures.

A template system should try to leave all the text in the template or in data files, with code logic filling in variables, selecting which data files to display, etc. The template is itself representative of some grammar, a little language for display. You correctly recognised that as code, but I think you missed by designing it back into the perl layer.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: RFC: Template::YetAnother
by domm (Chaplain) on Nov 16, 2002 at 16:19 UTC
    Looking at your coded $data, that doesn't seem much different in concept from the html generation available from CGI.pm.

    Hmm. There is indeed some similarity. But there are two important differences:

    1. CGI.pm only does HTML-tags. My proposed system would handle anything you could write a template for.
    2. The HTML-generating functions of CGI.pm return the finished HTML-string. My proposed system would return an object that would stringify only whern requested to do so (e.g. by calling $th->fill)
    You correctly recognised that as code, but I think you missed by designing it back into the perl layer. See my reply to Ovids post above.

    I am still not sure if i missed with my idea or just didn't describe it properly...

    -- #!/usr/bin/perl for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://213307]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2021-09-20 17:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?