http://www.perlmonks.org?node_id=765225

thiagu_mvt has asked for the wisdom of the Perl Monks concerning the following question:

When we wrote testcase that has forking inside results are printed twice. Can we correct this ?
[host1]$ cat test.pl use Test::More tests => 2; sub for{ my $pid = fork; if($pid == 0 ){ }else{} waitpid($pid,0); } $a = "hi"; ok ("hi" eq $a); ok("1" eq &for());
[host1]$ perl test.pl 1..2 ok 1 not ok 2 # Failed test (test.pl at line 14) not ok 2 # Failed test (test.pl at line 14) # Looks like you failed 1 tests of 2.
Thanks,
Thiagu