in reply to Conditionally including modules
Here's how Lingua::Identify loads all the Lingua::Identify submodules without having any information on which modules those are (it first searches them and it then loads them, but note that I take a step to prevent from loading modules that don't look like language modules (perhaps future configuration files?)):
use Class::Factory::Util; for ( Lingua::Identify->subclasses() ) { /^[A-Z][A-Z]$/ || next; eval "require Lingua::Identify::$_ ;"; $languages{_versions}{lc $_} >= 0.01 || die "Required version of language $_ not found.\n"; }
|
|---|