in reply to Re^2: reference to a subroutine inside a package
in thread reference to a subroutine inside a package

but yes i have to instantiate the class and pass it as an argument (that's not problem, well if you are an OO purist it is)
why would that be a problem for OO purists?
    $object->$coderef($arg1, $arg2, ...);
seems to be perfect OO style...

update: one might think (i thought that too for a while) that only
    $coderef->($object, $arg1, $arg2, ...);
will work, which, of course, isn't too nice OOP.

Replies are listed 'Best First'.
Re^4: reference to a subroutine inside a package
by Happy-the-monk (Canon) on Jun 03, 2004 at 11:40 UTC

    seems to be perfect OO style...

    Because you are used to seeing this. Some OO purists dislike arguments (to methods, not the other kind). They would probably prefer it like this:

            $object->$coderef( $object->$other_coderef_to_access_arg1_through_argn );

    Cheers, Sören

      Some OO purists dislike arguments (to methods, not the other kind).
      that's new to me. i wonder how it's possible to program without arguments.