in reply to use module question.

The Monks above are all correct that using require or use if will allow you to load the module at runtime based on your conditional. But I think this is a perfect place for taking advantage of one of the most powerful OO features, polymorphism.

use Human; use Mouse; my %classes = ( H => 'Human', M => 'Mouse' ); my $species = get_species(); # returns 'H' or 'M' my $organism = $classes{$species}->new;

This will allow you to instantiate a different object depending on whatever is returned by the get_species function. For more, take a look at perltoot.