At 03:22 PM 9/4/2007 +0100, George wrote:
>I've made the sure the data is actually coming back by putting a print
>in the while loop and that shows that it's coming back from the child.
>All the data makes it back, but the while loop doesn't finish and the
>timeout alarm hits, so the child gets reaped. When it's reaped it
>returns "Interrupted system call".
> while(<CHILD>) {
> #last if $_ eq "# DONE";
> if ($_ eq "# DONE") { close(CHILD); }
> push @lines,$_;
> print "#DEBUG CHILD: $_" if $DEBUG;
> }
I've never heard of munin but I see one problem right here. This while loop
will never exit. The <> operator only fires when a new line sequence is
encountered. However ur equality test doesn't have a \n in it and there's
no chomp() on $_. Try this:
while(<CHILD>) {
chomp $_;
#last if $_ eq "# DONE";
if ($_ eq "# DONE") { close(CHILD); }
push @lines, $_;
print "#DEBUG CHILD: $_" if $DEBUG;
}
This way when the child script prints a "# DONE\n" the loop will recognize it.
--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis"
00000100
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs