in reply to
Checking and installing a perl module
You could eval a use of the desired module and check $@ afterwards.
How do you want to install the module? With CPAN? With system's package system?
I'd prefer that the script aborts with an information for the user, if the module is not installed. Let the user handle the installation of modules. Best of all, this already happens when using a not installed module.
Don't mess up the system installation ... How do you know the user's preferences where to install which modules?