Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Perl::TK - fileevent and script execution theory

by crabbdean (Pilgrim)
on Mar 25, 2004 at 00:27 UTC ( #339597=note: print w/ replies, xml ) Need Help??


in reply to Re: Perl::TK - fileevent and script execution theory
in thread Perl::TK - fileevent and script execution theory

I've noticed in the above code that instead of exiting at the eof(CHILD) section it exists at the bottom "else" statement. All exiting commands I'm wanting to execute such as cleanup or "destroys" I'm putting here, which seems illogical. I would have thought it would exit at the "eof". Is there a reason for this?

Update: It would seem more correct to put the whole bottom "sysread" if statement as and "else" to the "eof". See below.
if (eof($handle)) { $widget->fileevent($handle, "readable", undef); # cancel bindi +ng return ; } else { if (sysread ($handle, $_, 128)) { $tx->insert('end', $_); # Append the data read $tx->yview('end'); } else { $tx->insert('end', times); $tx->yview('end'); $widget->fileevent($handle, "readable", undef); # cancel b +inding return; } }

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://339597]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2016-06-26 06:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (328 votes). Check out past polls.