Home > Archive > PERL Beginners > November 2007 > Check if a module is installed properly
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Check if a module is installed properly
|
|
|
| Hi Forum,
It happened that i tried installing Net::SSH::Perl from cpan. After
a long haul and installing most of the dependencies it happend that
installation was aborted in between with the message.
########################################
##########
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/02-buffer.t 2 512 19 38 200.00% 1-19
t/03-packet.t 2 512 10 20 200.00% 1-10
Failed 2/6 test scripts, 66.67% okay. 29/116 subtests failed, 75.00%
okay.
make: *** [test_dynamic] Error 255
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
########################################
####
So i Thought to install all the dependencies manually which were
listed in the README file ,...
I used the following command to check if all the dependencies are
installed
perl -M<modulename> -e 'print $<ModuleName>::VERSION'
and to my surprise i found that all the dependencies were
installed ....
When I tried to perl -e "use Net::SSH::Perl" it showed no error
but perl -MNet::SSH::Perl -e 'print $Net::SSH::Perl::VERSION' was
unable to print the version .
I havent tried using the module in actuall program yet. Just wanted to
make sure beforhand if it is fully installed....
---------
Nexis
http://startperl.blogspot.com/
| |
| Tom Phoenix 2007-11-13, 7:00 pm |
| On 11/13/07, jeevs <jeevan.ingale@gmail.com> wrote:
> Failed 2/6 test scripts, 66.67% okay. 29/116 subtests failed, 75.00%
> okay.
> I used the following command to check if all the dependencies are
> installed
>
> perl -M<modulename> -e 'print $<ModuleName>::VERSION'
>
> and to my surprise i found that all the dependencies were
> installed ....
That trick may not work for every module, but most have a package
variable like that giving the version number. Of course, printing the
version number doesn't prove that the module is _correctly_ installed,
although it's a big step in the right direction.
> When I tried to perl -e "use Net::SSH::Perl" it showed no error
> but perl -MNet::SSH::Perl -e 'print $Net::SSH::Perl::VERSION' was
> unable to print the version .
It seems that that module is immune to your trick. That doesn't mean
that it's not installed, though.
> I havent tried using the module in actuall program yet. Just wanted to
> make sure beforhand if it is fully installed....
Try running the test scripts again. The module and its prerequisites
are fully and properly installed if and only if all of the tests pass.
You can generally find the test scripts in a directory named t at the
top of the module distribution. If it passed all tests before you
installed it, it should still pass all tests now. Using the test
scripts is the One True Way to find out whether your modules are
properly installed.
Hope this helps!
--Tom Phoenix
Stonehenge Perl Training
| |
|
|
| Rob Dixon 2007-11-14, 10:01 pm |
| jeevs wrote:
>
> It happened that i tried installing Net::SSH::Perl from cpan. After
> a long haul and installing most of the dependencies it happend that
> installation was aborted in between with the message.
>
> ########################################
##########
> Failed Test Stat Wstat Total Fail Failed List of Failed
> -------------------------------------------------------------------------------
> t/02-buffer.t 2 512 19 38 200.00% 1-19
> t/03-packet.t 2 512 10 20 200.00% 1-10
> Failed 2/6 test scripts, 66.67% okay. 29/116 subtests failed, 75.00%
> okay.
> make: *** [test_dynamic] Error 255
> /usr/bin/make test -- NOT OK
> Running make install
> make test had returned bad status, won't install without force
>
> ########################################
####
>
>
> So i Thought to install all the dependencies manually which were
> listed in the README file ,...
> I used the following command to check if all the dependencies are
> installed
>
> perl -M<modulename> -e 'print $<ModuleName>::VERSION'
>
> and to my surprise i found that all the dependencies were
> installed ....
>
> When I tried to perl -e "use Net::SSH::Perl" it showed no error
> but perl -MNet::SSH::Perl -e 'print $Net::SSH::Perl::VERSION' was
> unable to print the version .
>
> I havent tried using the module in actuall program yet. Just wanted to
> make sure beforhand if it is fully installed....
As Tom has explained, this is a less than thorough test of the modules'
correct installation. What is your question?
perl -MNet::SSH::Perl -e "print $Net::SSH::Perl::VERSION" works fine on
my system; what exactly do you mean by "unable to print the version"?
Rob
| |
|
| I really m not getting what exactly I was doing wrong. But the next
time I tried the same thing to see the version i.e perl -
MNet::SSH::Perl -e "print $Net::SSH::Perl::VERSION" , it worked...
I am so thankfull for your valuable comments.
-------------
Nexis
http://startperl.blogspot.com
|
|
|
|
|