Re: (no subject)
Jochen Cichon <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.html-template |
|---|---|
| Message-ID | <[email protected]> |
>> >>>Well, I'm probably missing something (or everything), but >>it seems to me >> >>>that the following compiled code layout could solve the problem: >>> >>> JUMP to A IF false >>> ... # first true instruction >>> ... >>> ... # last true instruction >>> JUMP TO B >>>A: ... # first false instruction >>> ... >>> ... # last false instruction >>>B: ... # normal execution after the IF/ELSE, if any... >> >>Yup, that would do it. That's much easier than trying to store state >>from the first one. So, when can I see a patch? > > > Well, I just didn't want to steal such a privilege to the person who > originally pointed out this issue ;-) > > Joking apart, I'll be more than happy to work on a patch, as soon as my > clients give me a break and my newborn first son here will stop crying! > > Any further hint about it? > > --Emanuele. Hey cool, So I just have to wait ;) right now my workaround does a regexp and replace the rand function with the value of the evaluated part... so a <tmpl_if expr="int(rand(10))"> becomes a <tmpl_if expr="int(4.3332)"> or something similar. Thats fair enought, but anyway, only usable on a few steps... so sometimes I do a fallback onto the current timestamp (milliseconds). But as I say thats only a workaround (read the file, precompile, give it to HTML::Template::Expr) Bye, ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar