I constantly have to set up new servers for an employer of mine for an exact purpose of his, and as such they all have to be set up in exactly the same way. So I've created a script in PHP that I run from my own box to automatically send over all the relevant files, compile everything, run updates, and everything else.
However, for some reason these brand new servers come with perl, which is fine, but they have perl installed in different locations. This makes it a pain for me to copy over Config.pm
for CPAN without going in and finding the location manually.
Is there perhaps some command I'm unaware of that will hunt down the precise location?
If it helps, usually the servers are CentOS 5
will find the location of Perl in the path.
If
mlocate.db
is up to date, you can useAnother way to find likely locations for
CPAN.pm
:Use the
which
command to get the path of perl:Use the
find
command in linux to look for CPAN:You're doing it wrong and making more work for yourself.
Investigate configuration management tools (Puppet, Chef) or deployment tools (radmind) -- If you deploy your systems with something like the tools I just mentioned you will know that every box is truly identical, and more importantly that they'll be kept that way.
Until you have the time to do that,
locate
orfind
as others have mentioned will at least tell you where the file you want lives.Faster than Ava Gailliot's suggestion and with fewer false positives:
The path here is all the directories of your perl installation where perl is allowed to look for modules to load.