My code skeleton looks like: my $window = Tk::MainWindow->new(); my $book = $window->NoteBook(); #geometry, pack, title etc @input=("corner1","corner2")#generated by another loop #other buttons frames etc foreach my $corner (@input) { $tab = $book->add("TAB $index", -label => "$corner"); $for_display=$tab->Scrolled('Text', )->pack(); #blah blah $CHILD = IO::Handle->new; open($CHILD, "$unix_command 2>&1 |"); $logWindow->fileevent($CHILD, 'readable', [\&callback,args]); } #then using sub callback will insert the $_ if sysread.