water has asked for the wisdom of the Perl Monks concerning the following question:
Hi --
I have a set of classes like this:
That is, I set up a bunch of superthin subclasses of a base class -- they only differ between themselves in the class name.package A; # much base code which Does The Right Thing based on subclass type # thru ref($self) inspection 1; package B1; use base(qw(A)); # no code here 1; package B2; use base(qw(A)); # no code here 1; package B3; use base(qw(A)); # no code here 1; etc
Is there a way to dynamically generate the B1 ... Bn classes on the fly at execution, vs. creating them in B1.pm, B2.pm, etc. ?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Autocreating Classes
by Joost (Canon) on Oct 07, 2006 at 12:18 UTC | |
Re: Autocreating Classes
by gellyfish (Monsignor) on Oct 07, 2006 at 10:42 UTC | |
Re: Autocreating Classes
by stvn (Monsignor) on Oct 07, 2006 at 13:26 UTC | |
Re: Autocreating Classes
by fenLisesi (Priest) on Oct 07, 2006 at 12:46 UTC | |
Re: Autocreating Classes
by Tanktalus (Canon) on Oct 07, 2006 at 16:11 UTC | |
Re: Autocreating Classes
by chromatic (Archbishop) on Oct 07, 2006 at 19:53 UTC |
Back to
Seekers of Perl Wisdom