How do I create a constant in a parent class that I can use "simply" from a child class? E.g., I'm trying to avoid having to use $self->FOO at the same time I'm trying to avoid this warning:
Bareword "EMPTY_FLAG" not allowed while "strict subs" in use...
package ParentClass; use constant FOO => 'foo'; ... package ChildClass; use base 'ParentClass'; sub doStuff { my ($self, @otherArguments) = @_; ... #print FOO; # dang! this generates the 'Bareword "EMPTY_FLAG" not al +lowed...' error print $self->FOO; ... }
P.S. I looked already but didn't find an answer. If somebody's already answered this, please feel free to point me to that answer.
In reply to Constants and Subclasses... by t'mo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |