Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm thinking about setting up a script that opens an html file, and iterates over each line.

I've got a notion that if I were to "imbed" home grown tags in the file, and have the script do things based on these tags, I could control what happens by revising the tags in the html file.

example html lines:

<enviros>Recycle your aluminum</enviros>

<pigs>Throw your aluminum cans out the window</pigs>

The script looks for certain tags, and behaves accordingly.

My real question here is this: Do the home grown tags:

<enviros>yada</enviros>

present a problem, or should I use

<!--enviros-->yada<!--/enviros-->

comment type syntax instead ???
  • Comment on interpreting (via CGI) home grown tags in html

Replies are listed 'Best First'.
Re: interpreting (via CGI) home grown tags in html
by grep (Monsignor) on Aug 17, 2002 at 23:47 UTC
    This is an excellent idea. In fact it's be done before (at least 3X in fact).

    You are looking for a templating system. Here are the 3 most popular that I know of.

  • Template Toolkit - My personal favorite runs on Win32 and *nix, also does other templating besides HTML
  • HTML::Mason - also very good - requires Apache
  • HTML::Template - also very good


  • grep
    Mynd you, mønk bites Kan be pretti nasti...
Re: interpreting (via CGI) home grown tags in html
by Aristotle (Chancellor) on Aug 18, 2002 at 00:02 UTC