C
C. A.
I expect each child to have a different $slp, but they are identical:
=8<================
#! /usr/bin/perl -w
use strict;
my ( $pid, @jobs, $n );
$|++;
for (0..2)
{
# three children, we'll need their pid's later...
$pid = fork();
last if $pid == 0;
push @jobs, $pid;
}
if ( $pid != 0 ) {
$SIG{CHLD} = 'IGNORE';
} else {
my $slp = int rand 20;
print "child gets $slp second(s)\n";
exit 0;
}
=8<================
uname -r -v -m
7.3.0 Darwin Kernel Version 7.3.0: Fri Mar 5 14:22:55 PST 2004;\
root:xnu/xnu-517.3.15.obj~4/RELEASE_PPC Power Macintosh
perl --version
This is perl, v5.8.1-RC3 built for darwin-thread-multi-2level
(with 1 registered patch, see perl -V for more detail)
Yours,
CA
--
=8<================
#! /usr/bin/perl -w
use strict;
my ( $pid, @jobs, $n );
$|++;
for (0..2)
{
# three children, we'll need their pid's later...
$pid = fork();
last if $pid == 0;
push @jobs, $pid;
}
if ( $pid != 0 ) {
$SIG{CHLD} = 'IGNORE';
} else {
my $slp = int rand 20;
print "child gets $slp second(s)\n";
exit 0;
}
=8<================
uname -r -v -m
7.3.0 Darwin Kernel Version 7.3.0: Fri Mar 5 14:22:55 PST 2004;\
root:xnu/xnu-517.3.15.obj~4/RELEASE_PPC Power Macintosh
perl --version
This is perl, v5.8.1-RC3 built for darwin-thread-multi-2level
(with 1 registered patch, see perl -V for more detail)
Yours,
CA
--