1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use warnings;
use strict;
print "Start of script\n";
foreach(1..200) {
run_sleep($_);
}
print "End of script\n";
sub run_sleep {
my $i = shift;
my $pid = fork;
return if $pid; # in the parent process
print $i." - Running child process\n";
foreach(1..2){
print $i." - ".$_."\n";
select undef, undef, undef, 1;
}
print $i." - Done with child process\n";
exit; # end child process
}
2019-11-13T08:46:18 Gustl...
Aber warum schließt er die anderen nicht? Dachte mit dem exit; setze ich das end child process!?