in reply to Tk : Entry widget-Strange behaviour with decimals

Hello Caerwyn1955, and welcome to the Monastery!

I can reproduce your error message exactly under Tk version 804.033, but not under 804.034 (the latest version). I admit, the Tk Changes documentation has left me none the wiser as to an explanation for the error message in the earlier version.1 :-( Nevertheless, I think your first priority should be upgrading to the latest version of Tk and re-testing.

BTW, in cases like this you should specify both the version of Tk and the version of Perl you are using, along with your OS/platform. That will make it easier for the monks to give you the best advice.

Update: 1My thanks to choroba, whose solution of this mystery appears below.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Tk : Entry widget-Strange behaviour with decimals
by choroba (Cardinal) on Jan 06, 2018 at 14:19 UTC
    > Tk Changes documentation has left me none the wiser

    33_500 version Changes contains a suspicious item:

    > No special xOKp handling in Perl_Value (RT #121528)

    Searching for the bug shows it's indeed related:

    After tying a variable containing a float to an Entry box, NOT destroying the Entry box, and then multiplying the variable by 1.0, the variable is no longer treated as a float correctly.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      Very interesting indeed.
      Especially since it seems to be happening primarly with certain combinations of Perl and Tk versions.
      Funny to see that my initial suspicion was right, the entry()'d value is somehow converted to an integer.
      Concerning you other remark about versions, i looked it up, and i'll just put it ahead of my code from now on, starting each new program with:

      # Windows 7/64-bit
      # Perl 5.26.1.1 for MSWin32-x64-multithread
      # Tk 804.034

      So i won't forget to mention those anymore, and it's a good reminder for myself too.
      If you have any more remarks or advice on my little program, i'd be glad to hear it.
      J.

        or advice on my little program, i'd be glad to hear it.

        Since you asked, rather than using a lot of similar variable names like $row0, $row1 ,$row2 etc consider using an array. For example

        my @col = (40,$center-35,$center+30,$breed-40); my @row = (20,40,60,80,90,110);

        a few more changes (mainly style) here

        poj
Re^2: Tk : Entry widget-Strange behaviour with decimals
by Caerwyn1955 (Novice) on Jan 06, 2018 at 08:13 UTC

    To be frank, i don't have a clue what version of Tk i have, i thought i got the latest version (three days ago), but it didnt install, so i tried some stuff i found using google.
    That might have installed the pre-last version.
    I'll try to get the latest, and will include that kind of info the next time.

      To get the module version, type this from the command line:

      18:20 >perl -MTk -wE "say $Tk::VERSION;" 804.034 18:20 >

      (That’s under Windows. Under *nix, use single quotes around the code.)

      Or install Module::Version and then type:

      18:20 >mversion -f Tk Tk 804.034 18:20 >

      To get your Perl version, type either perl -v to get the summary, or perl -V (that’s an uppercase “V”) to get a lot of information about your Perl installation.

      Hope that helps,

      Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

      The update did the trick.
      Thank you, Oh Sensei !