Re: [tcltk-perl] return of 1=>1.0 transformation error
Brought to you by:
hobbs
From: Gisle A. <gi...@Ac...> - 2004-04-28 18:27:28
|
"Konovalov, Vadim" <vko...@sp...> writes: > > There are no integer literals in Perl. All numbers and arithmetics > > are/are done with doubles. If you want to force integers you need to > > declare that intention with the 'use integer' pragma. perl might try > > to use integers when it can get away with it and newer version are > > more aggressively doing so, but there are no guarantees. > > 'use integer;' will probably bring problems with having this pragma turned > on/off when user do not expect it to be changed somehow. The user code would have to use this pragma. It is lexical and it is the user's numbers we want to be ints. Because of this it is not a solution to this problem. I just mentioned it to describe how perl works. > Much better to early stringification early. Or just add more checks to the code so that it creates int objects whenever that would be an exact translation of the SV. A few more conditionals and it should be all ok again. --Gisle |