Is there a smart way to detect whether a certain Perl module has been installed in your system?
My old sutpid way is to write a Perl script in which the only thing I do is just to use the module. If nothing croaks when I run the detect script, then I know the module has been installed, although I still don’t know which version and where the module has been installed .
thanks in advance.
Something like:
would give you the version of a given module, or tell you it isn’t installed. Usage would look like:
To find the module path, you could examine
@INCto find possible locations, or you could perhaps look into perlwhich. There is also pmpath from pmtools.