I'm trying to repeatedly call some external program from Perl using backticks. This works fine for ~30 rounds, but then the program stops doing anything, with a <defunct> process hanging around (apparently Perl ignores its dead child?). A simple example is this:
#!/usr/bin/perl for (my $j=0;$j<10000;$j++) { my $result = `ls` ; print $result ; }
>ps uf 2740 pts/7 S 0:00 \_ /usr/bin/perl ./t5.pl 2894 pts/7 T 0:00 \_ ls 2895 pts/7 Z 0:00 \_ [ls <defunct>]
Any suggestion as to what's going on? Any way to avoid this? [This is Perl 5.8.0 under Linux]
Cheers, Martin
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>