Gidday all,
What I want to be able to do is create a file of frequently used Perl subroutines.
And call them from each presentation template.
I just can't get it to work.
I use iw_include to include my file
<iw_include file='/default/main/wwwschools/WORKAREA/schoolsdev/templatedata/schools/components/perlScripts.tpl' mode='cwd'/>
So here is the call to my subroutine from my master tpl
<iw_perl><![CDATA[
my $message = format_Message("Hello","World");
iwpt_output("<h1>$message</h1>");
]]></iw_perl>
And here is the contents of my file which I would like to include.
Has anyone had any success with this sort of thing, Im sure its possible, it would help to improve our templating.
<iw_perl>
<![CDATA[
sub format_Message{
my ($message1, $message2) =
@_;
return $message1." ".$message2;
}
]]>
</iw_perl>