httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@covalent.net>
Subject Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestServer.pm
Date Sun, 06 Jan 2002 01:35:35 GMT
On Fri, 4 Jan 2002, Stas Bekman wrote:
 
> Any idea how to disable the END blocks inheritance in the forked child? 

my $Pid = $$;

sub is_parent {
    $$ == $Pid;
}

my $pid = fork;

exit unless $pid;

END {
    print "END pid=$$\n";
    return unless is_parent();
    print "stuff\n";
}

prints:
END pid=2687
END pid=2688
stuff

without 'return unless is_parent()' prints 'stuff' twice.



Mime
View raw message