in reply to The costs of packages

This sounds an awful lot like a factory. Why not have a Types::Factory class, create an instance of it, then do something like my $typeA = $factory->new(type => 'TypeA', ...);? That not only is simple, keeps from you from making AUTOLOAD mistakes (the first being using the damn thing), and allows for options like:
my %types; foreach my $type (map { "type$_" } qw(A B C D E)) { $types{$type} = $factory->new(type => $type, ...); }

Keep

It

Simple,

Stupid

Second-best piece of advice my Dad ever gave me.

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: The costs of packages
by Anonymous Monk on Sep 17, 2003 at 04:30 UTC
    >Second-best piece of advice my Dad ever gave me. What was the first-best?
      Best advice my Dad ever gave me was "Find a rock to build your life upon." Now, I know he meant to use Jesus for this, but I went my own way and chose a slightly different path. *grins*

      He didn't talk to me for four years cause of it. *shrugs*

      ------
      We are the carpenters and bricklayers of the Information Age.

      The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

      Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.