Hi Fellow monks,

I just want to have small discussion on script execution in Perl::TK. If I have a script that takes a long time to execute I realise I have to call a "fileevent" on the file handle to read data without blocking and "freezing" the gui while the script executes.
$this -> fileevent(FILEHANDLE, "readable", \&callback);
Where I get stuck theory-wise is that what I'm executing would be a large directory read which in itself makes more subroutine calls while the filehandle is open. The callback is supposed to read and output what is read from the file handle. I'm just a little unclear how I'd write this into my MainLoop. The output is going to be put to a text widget or a log file.

Somethings not "clicking" for me. Am I making sense? Guidence appreciated.

Dean
The Funkster of Mirth
Programming these days takes more than a lone avenger with a compiler. - sam
RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers

In reply to Perl::TK - fileevent and script execution theory by crabbdean

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.