$cmd = "tail -f /var/log/messages"; $fh = new IO::File; my $pid = $fh->open ("$cmd|"); die "can't fork: $!\n" unless defined $pid; Glib::IO->add_watch (fileno $fh, [qw/in hup err/],\&watch_callback, $fh);