Geo Geo - 4 months ago 11
Perl Question

Is using __PACKAGE__ inside my methods bad for inheritance?

If inside my code I'll have calls like:

__PACKAGE__->method;


will this limit the usability of this module, if this module is inherited?

Answer

That depends. Sometimes __PACKAGE__->method() is exactly what you need.

Otherwise it's better to use ref($self)->class_method() or $self->method().