:)
Is it a problem with local vs. global scoping or is it a garbage collection issue?
Both and neither (more both than neither)
The problem is, you don't know the answer :) you can't diagnose the problem :) its because of the way you write code :) you should change the way you write code :)
I personally wouldn't even try to diagnose it or explain it because I don't write code that way anymore , I won't debug it or help others write it that way .... its actually painful to try and figure out ... and I used to be really good at that but not anymore :)
What should I be doing to correct the problem?
In short, put every part of your program into named subs (relatively small ones), and pass all variables used as arguments, and use good var names; do this it shouldn't take long, and post what you get ... it will probably work the way you want it, but if it doesn't , I'll more than willing to help you fix that version
All the things detailed in Re^3: TK Gui Help (and the posts/links it links); its the spirit of strict, the spirit of coping with scoping;
stop using fake globsl , file scope my globals, lexical globals , global lexicals, you're nullifying the helpfulness of strict :) read about it http://perl.plover.com/flagbook/yak/Chi/slide040.html
make named subroutines , all variables used in subroutines are passed as arguments or created within subroutines
Change your sample posted programs to use more named subs, meaningfully named, pass them arguments, pass more arguments, to do this and you'll fix it
See non-tk (the above linked are tk) example of how many subs there are for each part Re^5: I need help with displaying newline or paragraph using perl on my website (pass arguments more subs)
anyway , before you get a chance to do this, zentara will probably step in to spoil my agenda :)
In reply to Re^9: TK Gui Help
by Anonymous Monk
in thread TK Gui Help
by GuiPerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |