use Tcl::Tk; my $int = new Tcl::Tk; # ..... $int->fileevent($fhbt, readable => \&process_keyboard); # .... $int->MainLoop;