in reply to Strange behaviour of Tkx in combination with Storable

That's probably because your $Value becomes an object with overloaded stringification, so it prints 111, but really is a reference to a scalar blessed into Tcl::Var package. Try storing "$Value" instead of just $Value to force stringification and store only the value you need.

Replies are listed 'Best First'.
Re^2: Strange behaviour of Tkx in combination with Storable
by JanLaloux (Novice) on Jan 04, 2014 at 10:37 UTC
    Thanks aitap.

    What I forgot to mention explicitely is that Storable crashes when retrieving the references to the Tcl::Var objects.

    I could avoid this by copying all parameters to new variables first and store those, but this is rather ugly. Do you see another way to make Storable see the correct data structure?

      You can make a reference to a stringified copy of your variable on the fly: store \"$Value", $filename, or, if you are storing a data srtucture, store { var => 1, anothervar => "$Value", ... }, $filename.

      Quotes explicitly transform anything into a string, and no object can survive that.