Hello, While I have not gotten the answer I am looking for worked out yet....and it might not be possible, I thought that I should post my test case. This is a rather long posting, so if you are not interested in dealing with gathering the output of long running process and displaying this output in a GUI that does not freeze waiting for output down the pipe, then you might want to delete this one. This version is designed for Unix, because I figure that if I can get it working there, then I have a chance of getting it working on win32. First, I wrote a small script that would add a line to a temp file every 30 seconds. This would allow my "long running program" to just be a "tail -f" on this file. Here is longrunningproc.pl: ======================== #!/usr/local/bin/perl -w use Date::Format; use strict; open(FH, ">/tmp/logrunproc.txt") or die "Could not open temp file:$!\n"; print FH "Long Running Process Temp File\n"; close(FH); for (my $i = 0; $i < 10000; $i++) { sleep 30; open(FH, ">>/tmp/logrunproc.txt") or die "Could not open temp file:$!\n"; print FH "Entering line #$i into temp file at " . ctime(time) . "\n"; close(FH); } ======================== Having done this, I setup a very basic Perl/Tk GUI that is only two commands and a text_area. If you select File->Normal then you will see the bahavior I am trying to avoid. The text area will perfectly represent the activity of the tail command, but the GUI will only refresh when it is written to, i.e. every 30 seconds. If you select File->Forked then you will see the topic at hand. I have managed to see 3-4 different behaviors, none acceptable, but all interesting. I even saw the output of the tail, as written by the child process after the fork, but this case was fragile and the app crashed. Here is is: ======================== #!/usr/local/bin/perl -w use strict; use Cwd; use Tk; use Tk::Menubutton; use Tk::Text; # Here are some global widget handles our $HMain; our $HTextArea; sub LogMessage { #Define variables our $HTextArea; our $HMain; $HTextArea->insert("end", @_); $HTextArea->see("end"); $HMain->update(); return; } sub BuildGUI { # First we define the variables our $HMain; our $HTextArea; my $main; my $menubar; my $filebutton; my $filemenu; my $text_area; my $status; $main = new MainWindow; $HMain = $main; # Here we set the global window handle variable $menubar = $main->Frame(-relief=>"raised", -borderwidth=>2); $filebutton = $menubar->Menubutton(-text=>"File", -underline => 0); $filemenu = $filebutton->Menu(); $filebutton->configure(-menu=>$filemenu); # Create menu choices. $filemenu->command(-command => \&Launch1,-label => "Normal"); $filemenu->command(-command => \&Launch2,-label => "Forked"); $filemenu->separator; $filemenu->command(-label => "Exit",-command => \&ExitChoice); $filebutton->pack(-side=>"left"); $menubar->pack(-side=>"top", -fill=>"x"); # Create a Text widget for the main area. $text_area = $main->Scrolled("Text", -scrollbars => 'se', -font => "{Fixedsys} 10 {normal}",-wrap => 'none'); $HTextArea = $text_area; #Here we set the value of the global handle $text_area->pack(-side=>"top", -expand=>1, -fill=>'both'); MainLoop; # ENTER LOOP } sub ExitChoice { exit; } sub Launch1 { #Define variables our $HMain; my $i; LogMessage "\n\n=================LONG RUNNING PROCESS=================\n"; open(BPIPE, "tail -f /tmp/logrunproc.txt|") or die "Error launching the tail command: $!\n"; while (<BPIPE>) { LogMessage "$_\n"; $HMain->update(); } } sub Launch2 { #Define variables our $HMain; my $i; LogMessage "\n\n=================LONG RUNNING PROCESS=================\n"; use Errno qw(EAGAIN); use POSIX ":sys_wait_h"; my $pid; my $chld; my $ctr1 = 0; my $ctr2 = 0; FORK: { if ($pid = fork) { LogMessage "Hello from parent\n"; #parent process do { $chld = waitpid(-1,&WNOHANG); $HMain->update(); LogMessage "Parent just updated...ctr = $ctr1\n"; $ctr1++; sleep 2; } unless $chld == -1; } elsif (defined $pid) { LogMessage "Hello from child\n"; open(BPIPE, "tail -f /tmp/logrunproc.txt|"); while (<BPIPE>) { LogMessage "$ctr2:$_\n"; ++$ctr2; $HMain->update(); } close(BPIPE); LogMessage "Exiting Child\n"; exit; } else { die "Could not fork: $!\n"; } } $HMain->update(); } # # ELABORATION # BuildGUI(); ======================== I am coming to the conclusion that I cannot do what I want to do, and will work around by having the underlying call write to disk and I will loop, watching this file. Any thoughts on this approach (see the fork of launch2()) appreciated. Christopher -- Realisant mon espoir, je me lance vers la gloire Christopher Hahn: [EMAIL PROTECTED] _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users