The thingies one creates with use constant are subs, so you could just inherit them like any other method:
use strict; use warnings; package Foo::Constants; use constant PI => 3.1415826; package main; @Foo::Base::ISA = qw( Foo::Constants ); @Foo::Sub::ISA = qw( Foo::Base ); @Bar::Sub::ISA = qw( Foo::Sub ); sub Bar::Sub::new { my $class = shift; print $class->PI, $/; } Bar::Sub->new(); __END__ 3.1415926
the lowliest monk
In reply to Re: Any way to inherit constants?
by tlm
in thread Any way to inherit constants?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |