2 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
use strict;
use warnings;
our $test_text = "Die ist ein Text";
my $chd = fork();
if ($chd == 0) {
print "$test_text\n";
} else {
$test_text = 'blablablubb';
wait();
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use forks;
use forks::shared;
my $variable : shared;
$variable = "init";
my $thread = threads->new
(sub {
while() {
sleep 1;
print STDERR "\r", $variable;
}
});
while() {
print STDERR " "x40, "Enter new value for \$variable: ";
chomp($variable = <STDIN>);
}
2 Einträge, 1 Seite |