Do you need it in another program or do you just want to see it on the command line? By far the easiest way is described in Ivan's answer , i. Add a comment. Active Oldest Votes. That doesn't tell you where Perl is looking for the file, though. For Windows, might need to use double-quotes on the outside, single quotes on the inside. Command as given errors: Can't find string terminator "'" anywhere before EOF at -e line 1. I don't understand your comment.
Examples Locate the Data::Dumper module. Normally, only 1 path should be returned. Installation from the npm registry With Node. Thanks, Galaxy. The code you link to is definitely handy. This solution adds: detecting case-inexact names on OS X and Windows, core-module status, finding duplicates, and the ability to open modules directly for editing. Debugged program terminated. DB M 'AutoLoader. This will help in case when you have modules with same names but in different folder.
Ivan Nevostruev Ivan Nevostruev There will be some situations when you will need to know about installed modules, its version or you may need to check if required module is installed or not with mentioned version or higher than that. Try instmodsh command in linux box and then type l to list modules or m to give particular module name or q to quit.
This command itself is a perl script that use ExtUtils::Installed module. On the left, there is a link to download the code. Right-click and copy the link location or address, then paste it after wget into your terminal:. The above set of commands downloads and installs the perl module locally.
However, you still need to add this module to the perl environmental variables to let perl know where to look for the package. So how do we do this? If you are looking for more information about environmental variables in general, here is another blogpost link here explaining these terms and why they are important. Here are some perl-related environment variables that you might need or run into:. You may also want to explicitly unset these variables. This is especially true in cases where you want to share the code you install with others.
This is useful for setting up your own perl dependencies, but I find that installing manually and adding the files to PERL5LIB path is best for software packages that need to be widely shared.
So to fix the above-mentioned error in the above section , first, you should install the perl module from source and then add the modules to the environmental variable — PERL5LIB.
To do this run the below command. The resulting output looks like this:. Using a one-liner avoids the need to use CPAN, plus it neatly returns only the version number, which can easily be used for further processing:. Admittedly somewhat of a hack, but this will usually work. The output can be a messy, but you can usually locate the version number. This is a good option if methods 1 and 2 above do not work.
0コメント