Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: find the package name of an inherited object from inside the parent

by Corion (Pope)
on Jul 07, 2013 at 08:33 UTC ( #1042976=note: print w/ replies, xml ) Need Help??


in reply to find the package name of an inherited object from inside the parent

__PACKAGE__ is a constant like __FILE__ and __LINE__. What you might want is ref, which returns the class a reference is blessed into.

Just be advised that outside of debugging, there is very little you should do based on the class name.


Comment on Re: find the package name of an inherited object from inside the parent
Select or Download Code
Replies are listed 'Best First'.
Re^2: find the package name of an inherited object from inside the parent
by tomgracey (Beadle) on Jul 07, 2013 at 09:27 UTC
    Oh yeah! ref($self)! That really was a stupid question, apologies...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2016-02-08 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (275 votes), past polls