http://qs1969.pair.com?node_id=576817

water has asked for the wisdom of the Perl Monks concerning the following question:

Hi -- I have a set of classes like this:
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
That is, I set up a bunch of superthin subclasses of a base class -- they only differ between themselves in the class name.

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. ?

water