(no subject)

Jochen Cichon <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>
Hi,

i found a nice bug (that keeps me awake for about 3 hours...)


I have the following template:

<tmpl_if expr="(int(rand(2))==0">
   YES
<tmpl_else>
   NO
</tmpl_if>

which is not that complicated.


When you run the program, and the expr is evaluated to FASLSE then there 
is no problem and you get
     NO
in the outut.

BUT (!) if the expr is TRUE then the document is parsed again (don't ask 
why) and now comes the clue.
IF the expr on the second run returns the same result as on the first 
run, you will get
     YES
but if the results are different on the two runs you will get
     YES
     NO

... Whoops.


Any Ideas?


It seems not to be a problem with the rand, it seems more to be a 
problem when the expr is somehow different in the two runs.

So why is ist pared twice? (sometimes!)
test.tgz (application/octet-stream, 299 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.