Geo Geo - 1 year ago 79
Perl Question

Is using __PACKAGE__ inside my methods bad for inheritance?

If inside my code I'll have calls like:


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

Answer Source

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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download