NaSe77 has asked for the wisdom of the Perl Monks concerning the following question:

Hello again fellow monks,

i have a little problem : i'd like to write a frontend for a script that i have written , so far no problem the wasn't to be solved but now when i would like to start the script more than one time withe the same instannce of the frontend i get:

error: coudn't locate object OPEN via package Tk::Event::IO (perhaps y +ou forgot to load Tk::Event::IO?) at blah line blahblah
the thing is i have
($pid = open (CHILD,"-|"))||exec "perl script.pl"; $main->fileevent(\*CHILD,'readable',[\&fill_text_status]); sub fill_text_status{ $_ =<CHILD>; if (/^EOF$/){ #child send EOF if done $status->configure(-text=>"Status area"); close CHILD; return; } chomp; $status->configure(-text=>$_); }
notes:
- $status is my statusbar in the mainwindow
- i tried to load Tk::Event::IO but i get the same message

NaSe

Replies are listed 'Best First'.
Re: problems with fileevent
by NaSe77 (Monk) on May 17, 2002 at 12:52 UTC
    i found my error its rather
    ($pid = open (CHILD,"-|"))||exec "perl script.pl"; $main->fileevent(\*CHILD,'readable',[\&fill_text_status]); sub fill_text_status{ $_ =<CHILD>; if (/^EOF$/){ #child send EOF if done kill ("TERM",$pid) if $pid; $pid = undef; close CHILD; $main->fileevent(\*CHILD,'readable',''); return; } chomp; $status->configure(-text=>$_); }
    but i still wonder if there is a more elegant way to do this ...

    NaSe