![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Injecting local variables into a templateby MistaMuShu (Beadle) |
on Feb 06, 2008 at 05:23 UTC ( #666473=perlquestion: print w/replies, xml ) | Need Help?? |
MistaMuShu has asked for the wisdom of the Perl Monks concerning the following question: Hello Monks! After a long hiatus from the site, I'm back again :) I've been toying with a side pet project for publishing HTML files. What I'm trying to achieve is similar to what ActionView, and other templating tools do. In publish.pl, let's say I have a subroutine 'layout' that has local variables $headline, $body, $url. Within this sub, I'd like to call another script 'article.layout.pl', but with the local variables $headline, $body, and $url available to the script. 'article.layout.pl' would then use these variables to print out the final layout. In publish.pl
In article.layout.pl
I realize I could use TemplateTookit to achieve this, but I was hoping to learn how to call mess with perl scoping in general. Thanks fellow monks! It's good to be back.
Back to
Seekers of Perl Wisdom
|
|