in reply to Factory Pattern

I would try something more like:
package Cow; use base qw(Animal); __PACKAGE__->makes_sound_like('moo'); ...
Then any parent class that chooses to squirrel that away can add:
package Animal; sub makes_sound_like { my $class = shift; my $sound = shift; our %sound_registry; if (exists $sound_registry{$sound}) { croak "two animals want the sound $sound\n"; } else { $sound_registry{$sound} = $class; } }
Now the factory method can consult the locally prepared table, and can change the storage representation without all the derived classes being aware. In other words, this setup is far less maintainence, and far less typing the same thing twice or more.

At least, that's how I'd design it. {grin}

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.