I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-02-12 11:24:05.031024-08 by jdhedden in response to 12373
Re: Shared variables across require?
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;
Direct Responses: 12376 | Write a response