Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Detecting which class a method is defined in

by merlyn (Sage)
on Apr 02, 2011 at 16:49 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://897107]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-28 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found