|
Sorry, hit 'submit' before I was ready. Here's the correct code:
parent.pl:
#!/usr/bin/perl
use strict;
use warnings;
use threads;
use threads::shared;
our %tid : shared;
sub start_th {
$tid{hello} = 99999;
print($tid{hello}, "\n");
require "child.pl";
print($tid{hello}, "\n");
}
start_th;
child.pl:
use strict;
use warnings;
use threads;
use threads::shared;
our %tid : shared;
$tid{hello} = 11111;
1;
|