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)
if condition code not working in <iw_perl>
rohitspathak123
The problem is that I am not able to print the value of $maxDcrCount after the <iw_perl> TAG closes .
I think the control does not goes there , since it is not printing even the string "Max Count :" which i have written after </iw_perl>
The code snippet is as follows :
---------------------------------------------------
<tr>
<iw_perl>
my $i;
<![CDATA[
iwpt_output($pathPremiumDcr[1]);
if ($countIncludedDcr > $countPremiumDcr)
{
my $maxDcrCount = $countIncludedDcr;
}
else
{
my $maxDcrCount = $countPremiumDcr;
}
for ($i=1; $i <= $maxDcrCount ; $i++)
{
]]>
</iw_perl>
Max Count : <iw_value name="$maxDcrCount"/>:
--------------------------------------------------------------------------------
Kindly suggest any sollution
Find more posts tagged with
Comments
gzevin
I suggest that you read some manual on perl, in particular, on the scoping, and, furher, on scoping of the 'my' variables
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Chad_Hayton
Try first declaring your variables outside of your if-else. You'll also want to move your $i variable inside of the CDATA with the rest of the code. I'm assuming that the broken for loop at the bottom of your code is just a cut and paste error.
Chad--