Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Locate modules called by script

by jhourcle (Prior)
on May 10, 2005 at 15:11 UTC ( [id://455608] : note . print w/replies, xml ) Need Help??

in reply to Locate modules called by script

I need to figure out where all these modules reside to copy to the Linux system

I use the following to get info about where a module is, what other modules it ends up loading, and its version:

#!/bin/sh perl "-M$1" -e 'print map { sprintf( "%20s : %s\n", $_, $INC{$_} ) } s +ort keys %INC; print "\n'$1' version : $'$1'::VERSION\n\n"'

That being said, it's very important to look at where it is, before you decide to up and move it to a different architecture or OS. Take the following:

$ ./whichpm XML::Parser : /System/Library/Perl/5.8.1/ : /System/Library/Perl/5.8.1/ : /System/Library/Perl/5.8.1/darwin-thread-multi- +2level/ : /System/Library/Perl/5.8.1/darwin-thread-multi- +2level/ : /System/Library/Perl/5.8.1/darwin-thread-multi- +2level/ : /System/Library/Perl/5.8.1/ File/ : /System/Library/Perl/5.8.1/File/ File/Spec/ : /System/Library/Perl/5.8.1/File/Spec/ XML/ : /Library/Perl/5.8.1/darwin-thread-multi-2level/ +XML/ XML/Parser/ : /Library/Perl/5.8.1/darwin-thread-multi-2level/ +XML/Parser/ : /System/Library/Perl/5.8.1/darwin-thread-multi- +2level/ : /System/Library/Perl/5.8.1/ : /System/Library/Perl/5.8.1/ : /System/Library/Perl/5.8.1/ : /System/Library/Perl/5.8.1/ : /System/Library/Perl/5.8.1/ warnings/ : /System/Library/Perl/5.8.1/warnings/ XML::Parser version : 2.34

Any of the components with the architecture in their name (in this example, 'darwin-thread-multi-2level', have compiled components, and cannot just be picked up and moved to the new server.