http://www.perlmonks.org?node_id=590511

t'mo has asked for the wisdom of the Perl Monks concerning the following question:

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.