Hi Sam and all,

Seeing all the ideas about custom escape options, perhaps it's a good idea to redesign HTML::Template a little bit so that it stores a hash of escaper classname => object pairs. Each time a TMPL_VAR passes by with an escape option, HTML::Template converts that option (safely) to a classname such as HTML::Template::Escaper::XXXX. If HTML::Template hasn't already got an instance of this escaper class in it's hash, then an attempt is done to create an instance using require and store it in the hash. If the escaper object is in the hash then an escape method is called in the object using the data to be escaped as parameter.

This will make HTML::Template more flexible and everybody can write their own escaper classes without deteriorating the performance or increasing compile time and memory usage of HTML::Template for those who don't need these escape options.

This style of design is something you see on CPAN in modules such as DBI, Apache::Session, etc.

-Craig Manley

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing your web site with SSL, click here to get a FREE TRIAL of a Thawte Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to