If you don't want to write the accessors yourself as in dragonchild's example, you can use Class::Data::Inheritable, which lets you declare and override class variables on a per-class and even per-object basis.
package abstracted; use base qw(Class::Data::Inheritable); # Set up DataFile as inheritable class data. __PACKAGE__->mk_classdata('name'); __PACKAGE__->name('I call myself the abstracted class'); package abstracted::versionA; use base 'abstracted'; __PACKAGE__->name('vA'); package abstracted::versionB; use base 'abstracted'; __PACKAGE__->name('vB');
If you want to override the name of abstracted::versionA, you can also call the accessor at runtime.
In reply to Re: Accessing class/subclass variables
by Corion
in thread Accessing class/subclass variables
by nmerriweather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |