#The main lines are the open(IN, "...|") #and $tag = Gtk2::Helper->add_watch(fh,'in', sub {...} ) lines. ############################################# open (IN, "runme |"); while () { # do something with $_ } close (IN); ##############################################