Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: OOP: ->Coderef for calling Private Methods (possibilites?)

by ikegami (Pope)
on Dec 13, 2008 at 20:01 UTC ( #730193=note: print w/ replies, xml ) Need Help??


in reply to Re^4: OOP: ->Coderef for calling Private Methods (possibilites?)
in thread OOP: Obj->Coderef for calling Private Methods

The second half of the documentation reads

the right side is a method name or a simple scalar variable containing either the method name or a subroutine reference, and the left side must be either an object (a blessed reference) or a class name (that is, a package name). See perlobj.

I don't see how it could be clearer that a reference is allowed.


Comment on Re^5: OOP: ->Coderef for calling Private Methods (possibilites?)
Re^6: OOP: ->Coderef for calling Private Methods (possibilites?)
by LanX (Canon) on Dec 13, 2008 at 20:30 UTC
    "either the method name or a subroutine reference",

    Till now, I haven't run any tests, but it's not clear to read if it's a subroutine reference to a method or just to any subroutine.

    some additional phrases and examples are missing!

    It's perfectly possible that perl might do a check if the coderef is in the STASH of the class.

    and I don't see why such a powerful feature should be hidden in 3 dispersed half-phrases in the perldocs.

    Cheers Rolf

      it's not clear to read if it's a subroutine reference to a method or just to any subroutine.

      There's no such things as methods. There are methods calls and subroutine calls.

      If you mean it's not clear whether the it's a method call or a subroutine call, what gives you the impression it can be anything but a method call?

        It's funny how you guys call the documentation perfect which talks about "methods" and simultaneously you say "There's no such things as methods".

        Why are you all so obsessed to deny that the documentation could be extended with some extra words on this feature?

        Sorry if I repeat myself, but the documentation should be clear for a beginner!

        so I'm leaving this discussion, it's saturday night and I will anyway stay minority!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://730193]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-11-24 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (135 votes), past polls