Hi. I am using a sub with my Tk module similar to;

sub tick { # Run every 1000 milliseconds. if ($toggle_scan_v eq 0) {return}; # Break out of this tick l +oop # Do something $kount++; print "$kount "; $mw->after(1000, \&tick); # Suggest loop here print "No Error; we should get here often. \n"; }

I trust that whenever the "after" is executed, the print is executed, after which a graceful exit of the subroutine occurs. This provides dead time for the thread of execution. In turn other events belonging to this same thread may occur and execute (possibly turning $toggle_scan_v on and stopping this "tick" loop which is earmarked to execute 1000 mSec after the "after" method).

I trust that the subroutine is called and always subsequently returns in such a manner that there is no stack littering.?

Regards JC....


In reply to Tk module usage of after method by jmClifford

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.