Re: [htmltmpl] H::T filters
Brought to you by:
samtregar
From: Timm M. <tm...@ag...> - 2004-02-11 14:07:56
|
At 09:50 AM 2/11/04 +1100, Mathew Robertson wrote: >Hi list, > >A little while ago, I asked people for implementations of various filters >that are used, so that we could create a module which contains generic >filters. Well here it is.... Attached is a module which implements some >generic filters. If anyone has others that they would like added, please >send them to me. I'm glad somebody took the time to do this. A little constructive criticism: --Use of $_ should be avoided in modules. It's easy to screw up the localization and clobber existing values of $_ in code higher up. This can be solved either by using a regular variable, or by explicitly localizing it. --When you create the string used to match tags, it will be faster to wrap it in a qr// instead of a simple string. This will cause perl to compile the regex once instead of repeatedly compiling it at runtime whenever the string is interpolating into the s///. Otherwise, I like it. Thanks, Timm |