in reply to Re^2: OO: Factory vs. "Seed" (?) pattern
in thread OO: Factory vs. "Seed" (?) pattern

A factory is normally implemented as a class method ("static method" in Java parlance). You can do this then, as dragonchild pointed to above.

my $food_object = AnimalFoodFactory->prepare_correct_chow(animal => 'lion');

Incidentally, there's a technique for cheap aliasing of long package names that can in a pinch do some of the work of factories. Take a look at my home node.