Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Detecting which class a method is defined in

by merlyn (Sage)
on Apr 02, 2011 at 16:49 UTC ( #897107=note: print w/ replies, xml ) Need Help??


in reply to Detecting which class a method is defined in

I don't think you're getting OO yet. If you have to introspect that much, you probably aren't building actual subclasses, but rather something like plugins (HAS-A vs IS-A). If designed properly, you should just call $self->source, and it'll Do The Right Thing.

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.


Comment on Re: Detecting which class a method is defined in
Download Code
Re^2: Detecting which class a method is defined in
by yngwi (Initiate) on Apr 02, 2011 at 17:41 UTC

    Let me add that source() is intended to be a class method (essentially an inheritable constant), and that the goal would be to create new class methods storing additional data derived from source() at the points in the class hierarchy where source() is defined or re-defined.

    It is true that the system could be redesigned to handle this better. But I was primarily interested in whether the information where Perl ultimately finds a method is accessible.

Re^2: Detecting which class a method is defined in
by Anonymous Monk on May 05, 2011 at 19:41 UTC
    what you're saying is if he's developing a low level or mid level tool, or something for developers, he should forget about it. hey look two of us can ignore a post and offer incorrect conjecture

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-09-01 15:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (14 votes), past polls