The class of your current object would be ref $self and the class where the method is defined in would be __PACKAGE__ (or CLASS, if you use CLASS.pm). I'm not sure if this is the answer you're looking for, but maybe Carp gives you more hints about walking the caller chain to find what information you want. rubyisms.pm also does some funky caller walking to make self behave like $_[0]...
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
In reply to Re: How to identify calling class whilst in inherited method
by Corion
in thread How to identify calling class whilst in inherited method
by set_uk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |