develooper Front page | perl.perl5.porters | Postings from May 2003

threads::shared need to override bless

Thread Next
Arthur Bergman
May 14, 2003 15:27
threads::shared need to override bless
Message ID:

threads::shared will need to override bless, the problem is that 
currently there is no way to catch a bless on a shared variable, so it 
will be ok in the local copy but not in the shared copy.

This quick example shows what happens.

use strict;
use threads;
use threads::shared;

my $self = bless &share({});
bless $self;
my %bar : shared;
$bar{foo} = $self;
my $foo = $bar{foo};
print "$self - $foo\n";

The, question is, should I override CORE::GLOBAL::bless or should I 
export bless? I suggest exporting my own bless.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About