Subject: | Can't share ref 'CODE'. |
Distribution: threads-shared-1.26
Perl version: 5.8.8
OS: Win XP x86
When I try to share ref type 'CODE' it fails.
Message is: "Cannot share subs yet".
P.S. BTW, there is nothing about that limitation in perldoc.
Subject: | test.pl |
#!/usr/bin/perl
use strict;
use warnings;
use threads;
use threads::shared;
our $funcref :shared; # Pointer to Function. Eg. "CODE".
sub dummy {
print "I\'m a dummy sub\n";
}
print "Trying to set shread value to CODE.\nIf this don\'t print \"WOW\", then we failed.\n";
lock ($funcref);
my $new_funcref = \&dummy;
$funcref = share($new_funcref);
print "WOW.\n";
$funcref->();