I have some issues with TK MainLoop contorl. i have 2 perl scripts(.pl) and 2 perl modules(.pm) created by myself.

script 1. mainprog.pl has TK widgets (button) and depending on which button the user 'clicks', main script will run that perticular (2nd) perl script.

script2. this 2nd perl script in turn calls other 2 perl modules and each module has its own TK mainloop contorl. in this script i have called module1 first and module2 next

the problem is when i run the script#2 first, everything works fine without any problem. however if i run the script#1 first which calls script#2 then the module1 and module2 is activated simultaniously.

in other words if i run the script#2 then module1 is run first and WAITS for 1 TK mw to finish. then only it runs second module. however if i run this from main script then both module1 and module2 are run at a time.

how do i fix this?

Edit: g0n - basic markup


In reply to MainLoop control by shreedarasp

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.