0

I keep getting this when i try to run an SSH login

Can't locate Net/SSH/Perl.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /scripts/test/ssh line 2. BEGIN failed--compilation aborted at /scripts/test/ssh line 2.

but perl says its up to date

[root@SCRIPTS /]# cpanm Net::SSH::Perl
Net::SSH::Perl is up to date. (1.35)
[root@SCRIPTS /]#

the module says its up to date so im not sure where the issue is the script starts as follows :

#!/usr/bin/perl
use Net::SSH::Perl;

any help would be appreciated

DjTazie
  • 3
  • 3
  • How did you install `Net::SSH::Perl`? If you used `cpanm`, there could have been permission issues and was installed somewhere below `~/`. If that's the case you will have to add this path to your `PERLLIB` – chrsblck Mar 15 '13 at 17:28
  • It doesn't look like ~/perl5/lib/perl5 is in the @INC. And as per chrsblck, that's probably where cpanm installed it too. – kjprice Mar 15 '13 at 18:29
  • What's the output of `head -1 "$( which cpanm )"`? – ikegami Mar 15 '13 at 19:03
  • Do you get the error message for `/usr/bin/perl -le'use Net::SSH::Perl; print $INC{"Net/SSH/Perl.pm"}'` run as root or do you get a path? – ikegami Mar 15 '13 at 19:05
  • Try `perldoc -l Net::SSH::Perl` from the command line. This will either print out that the module can't be found or its location. From there, we can work out other possible issues. – David W. Mar 15 '13 at 19:15
  • The output is #!/usr/local/bin/perl for head -1 "$( which cpanm )" – DjTazie Mar 19 '13 at 14:43
  • [root@SCRIPTS]# perldoc -l Net::SSH::Perl /usr/local/lib/perl5/site_perl/5.17.4/Net/SSH/Perl.pm – DjTazie Mar 19 '13 at 14:44
  • @ikegami when i put in the command you have i get the error when i change the path to perl to /usr/local/bin/perl i get this back : /usr/local/lib/perl5/site_perl/5.17.4/Net/SSH/Perl.pm – DjTazie Mar 19 '13 at 14:48
  • So you have to installs of Perl. Where's the executable for the 5.17.4? `/usr/local/bin/perl`? (But why are you using a dev release? 5.odd is not for general use.) – ikegami Mar 19 '13 at 18:43
  • I just uninstalled all perl and started again and it seems its easier to use Net:SSH2 anyway so thanks guys - i have something working that gets me what i want now. – DjTazie Mar 20 '13 at 10:00

1 Answers1

3

So cpanm is using a different perl. Maybe you have a /usr/local/bin/perl which cpanm uses.

Try /usr/bin/perl -S cpanm to install your modules for your system 5.8.8

The hint to try perldoc -l Net::SSH::Perl should also use /usr/bin/perl -S perldoc -l Net::SSH::Perl instead, as perldoc may also use a different perl.

rurban
  • 4,025
  • 24
  • 27