|
I really appreciate the very fast response, but same problem. Now, thread it:
use strict;
use warnings;
use threads;
use threads::shared;
our %tid : shared;
sub start_th {
$tid{hello} = 99999;
$tid{hello} = 88888;
print("1: " . $tid{hello} . "\n");
require "child.pl";
print("2: " . $tid{hello} . "\n");
$tid{hello} = 22222;
}
my $myth = threads->create(\&start_th);
$myth->join();
print("3: " . $tid{hello} . "\n");
child.pl is a straight cut-and-paste of what you had. In fact...the 22222 didn't even register, and that's after the require--not in it. Comment out the require, and it does. I get 88888 with require, 22222 without.
|