in reply to Re: Re: Re: objects becoming unblessed?
in thread objects becoming unblessed?

You are missing one level of indirection. The objects are the keys of the unblessed hash (except that objects can't be keys). Look at the code again:
$self->{START} = Emitter->new(); $self->{FAIR} = Emitter->new(); $self->{LOADED} = Emitter->new(); ... $self->{START}->transitions( { $self->{FAIR} => 0.5, $self->{LOADED} => 0.5 } );
It does create 3 objects and then tries to set up 2 transitions using the anonymous hash. But the last line will already turn the object references into strings. It works as if it had been:
$self->{START}->transitions( { "Emitter=HASH(0x12345678)" => 0.5, "Emitter=HASH(0xABCDABCD)" => 0.5 } );

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: objects becoming unblessed?
by derby (Abbot) on Mar 17, 2003 at 18:12 UTC
    Okay. Yep. Add this to my list of reasons of why methods differentiated by only a letter is bad. I mis-read transtion and transtions (even after you pointed it out) and wrongly assumed transition returns $self->{TRANSITIONS}.

    Thanks for the wake-up.

    -derby