use threads(); { my $foo = 'bar'; sub foo () :lvalue { $foo } } threads->new( sub { foo = 'quux'; print 'thread: coderef = ', \&foo, $/; print 'foo is ', foo, $/; } )->join; print 'main: coderef = ', \&foo, $/; print 'foo is ', foo, $/; __END__ $ perl thrcl.pl thread: coderef = CODE(0x8129538) foo is quux main: coderef = CODE(0x8060674) foo is bar