On Wed, 10 Nov 1999, Ian Mahuron wrote:
> As per someone's suggestion I'll ellaborate on what's in the HTML...
> 
> Insert code for advertisment (there's 1,000's of different ads on the
> site.):
> <ADVERTISMENT id=252>
> 
> Insert news scroller:
> <NEWS_ITEM id=92834 bgcolor="#0066FF">
> 
> There will be at least 50 similar tags.. so I'm not parsing for just a
> couple of tags like HTML::Template..
> 
> I may implement IF/LOOPS/etc.. but not until I see the need.

As others have suggested, standardise on an alternate tag format. At the
BBC we did something like this and used double angle brackets for our own
tags:

<<FORUM-LOOP>>

<</FORUM-LOOP>>

etc. Then just use a regexp that looks for while(/<<.*?>>/sg). This is
extremely quick. Then go 1 better. Cache the results into a parse tree and
only re-parse when the source changes. Same principal as Apache::Registry
only in template format. I assume it's the same principal as Apache::ASP
and Embperl, but I haven't dug into their source code.

-- 
<Matt/>

Details: FastNet Software Ltd - XML, Perl, Databases.
Tagline: High Performance Web Solutions
Web Sites: http://come.to/fastnet http://sergeant.org
Available for Consultancy, Contracts and Training.

Reply via email to