in reply to Can I share instance through Moose::Role ?

Please, post a code that demonstrates the A->B->a() way of calling. Test the code before posting: there already is a module called B in Perl.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: Can I share instance through Moose::Role ?

Replies are listed 'Best First'.
Re^2: Can I share instance through Moose::Role ?
by dd1942 (Initiate) on Feb 10, 2014 at 09:37 UTC

    Hello choroba,

    I apologize for the untested code. And thank you for your reply.

    I've update my questions and the code. And I also found a workaround , although it is not "that" perfect.

    Just need copy the MyRole.nodes reference from consumer 'B' into consumer 'A'.

    Anyhow, currently it works for me, but still glad to see more better/safer solution that possibly don't need any copy?

    sub bind_vars { my $self = shift; my $instance = tie(%ENV,'BBB'); $self->BBB($instance); $self->nodes($instance->nodes); return 1; }