AriSoft has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
My little template programming excersize is getting a more compact solution.
Now I should find a way to substitute a simple function call by using a predefined perl program block. like #define foo(bar)... in C language does. Substitution seems to be mandatory because the block needs to see all local variables.
The block I should simplify is this.
$_ = $input; template::generate(state $compiled //= eval(template::translate()) || +die $@); $output = $_;
The statement I would like to use instead is this.
template::use($input, $output);
Unfortinately the eval() needs to exist in the calling source. It can not be moved to the class method.
|
|---|