in reply to I lost my "bless"ing.

Hrm, threads::shared seems to state that "bless is not supported on shared references." That's probably the biggest problem here. It's listed as a bug (at the bottom) but indicates that if you hold out it "is expected to be implemented in a future version of Perl."

-Paul

Replies are listed 'Best First'.
Re^2: I lost my "bless"ing.
by Wiggins (Hermit) on Dec 20, 2006 at 22:41 UTC
    But what use is a semaphore that is not shared? Like one hand clapping?
    Maybe the "shared" part is builtin.?
    So was it possible to use ::Semaphore in 5.8.5; and if so, how was it tested, if not shared between threads?

    Probably an imponderable of a misty past.

      This may be of interest... it's source from the Semaphore.pm:

      sub new { my $class = shift; my $val : shared = @_ ? shift : 1; bless \$val, $class; }

      It says that you don't need to share it because it's already shared. Also, note that the author shares the scalar and then blesses it... Not the other way around.

      Use the source Luke.

      -Paul