[Chicago-talk] constants and base pragma

Steven Lembark lembark at wrkhors.com
Thu Mar 16 14:41:07 PST 2006

Joshua McAdams wrote:
 >> If I do this in a non-OO manner everything works as expected. Is it 
not possible to
 >> export constants from a base class?
 >> Is there a better way?
 > If you can live without constant and with Readonly, this might be better:

You can also use NEXT::init to inherit configuration data:

     package Foo;

     use NEXT::init
         your => 'hash',
         data => 'here',

     package Bar;

     use base qw( Foo );

     use NEXT::init
         derived => 'hash',
         data    => 'there',

Bar->construct() will give you a hash of

     ( your => hash, data => there, derived => hash )

Simiarlly for arrays (stack or queue).

Shove the constants into, say, a hash and use them there.

Steven Lembark                                         85-09 90th Street
Workhorse Computing                                  Woodhaven, NY 11421
lembark at wrkhors.com                                      +1 888 359 3508

More information about the Chicago-talk mailing list