:)

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.