in reply to Re: Perl 5 numeric type and simplifications
in thread Perl 5 numeric type and simplifications
Imagine a weird bug in your 5k lines of perl code spread among different modules...
I have experienced this kind of bug, or perhaps strange behaviour would be a better term, very recently. In the past I have almost always passed the current user to the database to do the figuring out what to do. But as now all code is being written with Template thanks to the wisdom and good influence of the Monastery, more recently I have wanted the Template to do the work. I couldn't figure out why this wasn't working:
Until I printed out current_user from within Template to find it was left padded to 8 digits! MySQL queries treat 255 = 00000255 as true whereas Template treats [% 255 == 00000255 %] as false! I got around the issue by adding zero to the current user before passing it to the Template. I have no idea why the user is calculated and padded this way but too much other code relies on them that I dare not attempt to change this.[% IF user.idUser == current_user %]<input type="button" onClick="doSo +mething();">[% END %]
|
|---|