http://qs1969.pair.com?node_id=897107


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