http://www.perlmonks.org?node_id=428786


in reply to Testing for a module's presence

One way to find out if and where a module is installed, assuming it is a CPAN module, and not something you have written yourself is to use CPAN.pm:

perl -MCPAN -MData::Dumper -e 'print Dumper( CPAN::Shell->expand( "Module", "Test::More" )->inst_file )'

That will return the file location of the module if it is installed, and nothing if it is not.

I note that in your question you specifically mention you do not want to use the module. However, you might want to find a way around that requirement. The problem is that just testing for existence of the .pm file is not always sufficient to know if everything has been installed. It is also not sufficient if you need to know that the file compiles clean.