in reply to Re^3: OO Conversion Query - Sharing Data
in thread OO Conversion Query - Sharing Data

So just to confirm, I make a variable called our $igaro in the root igaro.pm module, then bless the instantiated parent into it.

It does sound the way forward. If I'm right in saying the parent is never passed to the child (first parameter is a reference to the instantiation of that child) then I'd have to use a global variable.

But if I use a global variable some of the lower pm modules will be always expecting the parent to be in a fixed variable name ($igaro), which seems a bad idea.

  • Comment on Re^4: OO Conversion Query - Sharing Data

Replies are listed 'Best First'.
Re^5: OO Conversion Query - Sharing Data
by educated_foo (Vicar) on Apr 13, 2013 at 13:20 UTC
    In brief:
    $x = bless \%data, Igaro; $x->foo(...); # calls Igaro::foo($x, ...)
    Beyond that, I suggest reading perltoot and perlobj. The newer object docs are inferior (and, annoyingly, are replaced by stubs so the link shortcuts here aren't helpful).
Re^5: OO Conversion Query - Sharing Data
by Anonymous Monk on Apr 13, 2013 at 07:17 UTC