Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Perl Includes in PT
davemackey
I am attempting to use perl includes require("common.ipl") in my presentation templates. I have this working for functions that do not access the DCR. When I attempt to read values from the dcr in a common include function. I receive an Preview and Generate error. Is there a special way of accessing DCR values from a function that is included.
#### Common ipl file
sub test1{
return "<test/>";
}
sub test2 {
return iwpt_dcr_value('dcrpath');
}
#### PT template
<iw_perl>
<![CDATA[
require("common.ipl");
iwpt_output(test1());
iwpt_output(test2());
]]>
</iw_perl>
If I comment out the second iwpt_output everything works fine.
TS 6.5
Window 2003
Thanks for your help.
Find more posts tagged with
Comments
chuckles
First off, this post belongs in the Templating forum. Second, you cannot require and ipl file. The .ipl extension is for executables which you can certainly run using a system call (see system() or backticks ``). The require keyword is for importing perl modules which should have a .pm extension (see perlmod). Is common.ipl a script or a module?
davemackey
It is a script.
jbonifaci
Please continue any of the discussion for this post in the duplicate post in the templating forum
here
.
~Jeff