This is going to be a long post, so please bear with me. I'm implementing a new site in Apache::ASP. I'd like to develop a framework similar to our existing mod_perl setup. The way we currently create a page is like so:
- Templater creates template.html - Contains several tokens like __TITLE__, __HEADER__, __BODY__, __LEFT_COLUMN__ - Some default variables are set: $var{'LEFT_COLUMN'}, $var{'FOOTER'}, etc. - Also contains some perl logic - Developer creates foo.html - Sets $var{'TEMPLATE'} to template.html - foo.html (optionally) contains variables like $var{'TITLE'}, $var{'HEADER'}, and $var{'LEFT_COLUMN'}. These append to or override those set in the template - Everything else in foo.html is treated as $var{'BODY'} - Also contains perl logic When a request comes in for foo.html, our perl module scans it for the template name, reads in and executes everything in template.html, executes everything in foo.html, substitutes all tokens with their values (__TOKEN__ with $var{'TOKEN'}), and spits out the result. Can I mimic this behavior in Apache::ASP? I've been trying things along the lines of (in foo.html): <my:template href="/templates/simple.inc"> WHEE! <% print scalar localtime %> </my:template> and then, in global.asa: sub my::template { my($args, $html) = @_; my $template = $Server->MapPath($args->{'href'}); my $template_ref = $Response->TrapInclude($template); $$template_ref =~ s/__BODY__/$html/; $main::Response->Write($$template_ref); } which works, but obviously only gets me halfway there. Can I declare variables like %var in foo.html that are accessible to the routine my::template? I can't set these as globals, because they're not. I really don't want our developers coding pages like: <!--#include file="everything_up_to_the_title.inc"> This is my title! <!--#include file="everything_from_title_to_left_column.inc"> This is my left column <!--#include file="everything_from_left_column_to_header.inc"> ... I've tried stuff like structuring foo.htm as XML, but parsing that with XMLin breaks because the HEADER and LEFT_COLUMN variables often contain arbitrary HTML. I'm open to any and all suggestions! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]