Hi,
Why does a Global sometimes just output the code when you include it on a page instead of the result?
Ex:
I inserted <%howhelpful%> into detailed.html and the Global is:
HowHelpful => sub {
my $tags = shift;
my $useful = $tags->{Review_WasHelpful};
my $notuseful = $tags->{Review_WasNotHelpful};
return "0" if (! $useful);
return "100" if (! $notuseful);
my $percent = $useful / ($useful + $notuseful);
my $round = (int($percent * 20 + 0.5) / 20) * 100;
return $round;
}
On the detailed page it just output the above code and not the result. I have experienced this before ?!?
Klaus
http://www.ameinfo.com
Why does a Global sometimes just output the code when you include it on a page instead of the result?
Ex:
I inserted <%howhelpful%> into detailed.html and the Global is:
HowHelpful => sub {
my $tags = shift;
my $useful = $tags->{Review_WasHelpful};
my $notuseful = $tags->{Review_WasNotHelpful};
return "0" if (! $useful);
return "100" if (! $notuseful);
my $percent = $useful / ($useful + $notuseful);
my $round = (int($percent * 20 + 0.5) / 20) * 100;
return $round;
}
On the detailed page it just output the above code and not the result. I have experienced this before ?!?
Klaus
http://www.ameinfo.com