Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
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.pl") 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.pl");
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
jbonifaci
There have been several posts about this recently. You can't use the iwpt functions in your module. There are way around it, like passing all of the information to your module and then manipulating it. Or, if you must, pass the DCR name and have the function open the DCR, parse it, and return what you want returned.
~Jeff
jbonifaci
Check out
this post
.
~Jeff