jh314
jh314

Reputation: 27812

Problems with using SFTP perl module

I'm trying to use the SFTP module in Perl. My code looks likes this:

#!/usr/local/bin/perl5 

use lib "/some_path/Net-SFTP-0.10/lib";
use lib "/some_path/Net-SSH-Perl-1.25/lib";
use lib "/some_path/Math-Pari-2.010709";

use Net::SFTP;

I get this error when running it:

Can't locate Math/Pari.pm in @INC

The Math-Pari-2.010709 directory contains the Pari.pm. I do not have permission to make a Math directory and put the Pari.pm file there. What can I do to fix this issue?

Upvotes: 0

Views: 1021

Answers (2)

jh314
jh314

Reputation: 27812

Following the comments, I ended up using Net::SFTP::Foreign. It is sufficient to get stuff done, and fewer dependencies made life easier on me. Thanks for all the help!

Upvotes: 2

G. Cito
G. Cito

Reputation: 6388

I use local::lib and set $PERL5LIB to $HOME/perl5 so building and installing missing modules is fairly easy:

% cpanm Math::Pari
--> Working on Math::Pari
Fetching http://www.cpan.org/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.01080605.tar.gz ... OK
Configuring Math-Pari-2.01080605 ... OK
Building and testing Math-Pari-2.01080605 ... 
Successfully installed Math-Pari-2.01080605
1 distribution installed

You'll need to install App::cpanminus by following the instructions at https://github.com/miyagawa/cpanminus which essentially are:

curl -L http://cpanmin.us | perl - App::cpanminus

After that with cpanm in your $PATH (here it is in $HOME/perl5/bin) installing modules in your own $HOME directory is a breeze.

Upvotes: 2

Related Questions