Also, perhaps take a look at the if module.
In reply to Re: Need help in dynamically loading a module by AnomalousMonk in thread Need help in dynamically loading a module by Sri Harsha