I have always came at this stop where i needed to check if a module is already installed or if so what is the version of the module.
perl -e "use [modulename]" e.g perl -e "use Net::SSH::Perl" will tell you if the module is installed or not. If its installed nothing happens and you get the prompt to perform new task. If it is not installed perl throws an error somewhat like can't locate Net/SSH/Perl.pm
perl -M[modulename] -e "print $[modulename]
Most of the packages has a package variable as VERSION which holds the version of the module.
However the only true way to determine if a module is correctly installed, one can run the test scripts provided in the t folder of the module distribution. If all the scripts can run successfully, then only one can be sure that a particular module is installed fully or properly.
Do let us know what method do you use to see if a perl module is installed on your machine.
Tuesday, November 13, 2007
One Liner : To check if a module is already installed
Posted by Nexis at 10:45 AM
Labels: perl modules, perl one liners
Subscribe to:
Post Comments (Atom)
1 comment:
how to check it if a perl module is loaded or not through program
Post a Comment