in reply to Re^2: Tk::Image delete method
in thread Tk::Image delete method

Could it be because you *re-load* perl and your script every time via that exec? btw how does user exit such a cycle? Or is it meant to be a virus? (re: cookie cookie i need a cookie now)

Replies are listed 'Best First'.
Re^4: Tk::Image delete method
by jcb (Parson) on Dec 19, 2019 at 00:22 UTC

    You may laugh, but I have written a Perl/Tk program (that persists its state on disk) using Tk::Table and ended up adding a menu item that does exec $0 upon user command because I found that it gets strangely slow after some amount of usage. That program is just a small "toy" for my personal use and an exercise in using Tk, so restarting it when it gets slow works well enough for me and the "simple hack" was far easier than tracking down exactly what is going wrong.

      hey i am not Harry Tattle and I am not the (youtube warning-->> ) Central Scrutinizer of memory leaks :))) However, I must note that a few days ago I was gutted when I learned that every android is potentially pwned because of a freeing-memory bug in libpng gloogle was too lax to fix for some time (for obvious-to-me reasons) ...

      On the serious side, if the exec frees all memory then that's as good as a manual memory deallocation i guess. garbage collection can manifest itself in many forms! :)

Re^4: Tk::Image delete method
by Anonymous Monk on Dec 18, 2019 at 11:34 UTC
    Could it be because you *re-load* perl and your script every time via that exec?

    Why not? It's simple and does what I want. I'm not getting any help making it work "correctly" therefore I hack until it does what I mean.

    btw how does user exit such a cycle?

    Same way it was started, in the console, with ctrl+c.

    Or is it meant to be a virus?

    How is it a virus? It's meant to be fun and productive. I have so many images and so little time to enjoy them. I love this program!

      I'm not getting any help making it work "correctly"

      That is because you should be reading the Tk documentation. There is a steep initial learning curve, but you are already part of the way up that curve.

        >> I'm not getting any help making it work "correctly"

        > That is because you should be reading the Tk documentation. There is a steep initial learning curve, but you are already part of the way up that curve.

        I apologize for saying that, because I am in fact getting very generous help from you (jcb) in 11110311 and bliako in 11110301, and thank you both. I will study the documentation on MainLoop, callbacks, and object destruction to try to get this done right. Thanks again!

      OK