This is just a wild shot in the dark, but the user option should not be in the hash handed to ssh_args, it is at the same level. Try using this code instead:
my $sftp = Net::SFTP->new(
$targetserver,
user => 'canneu_scp',
ssh_args => {
identity_files => [ '/home/home1/cgrshah/responsys/capgemini.private' ],
debug => 1,
}
) or die "could not open connection to $targetserver\n";
It sounds like the code above got you further along, and now you are having problems because your version of Math::BigInt is too old. I see three ways to move forward:
- switch to an RSA key instead of a DSA key
- find an RPM of
Math::BigInt version 1.78 or later
- manually install a copy of
Math::BigInt
The third option has many pitfalls, and if you decide to go with it I would suggest the following steps:
- install
App::cpanminus
- make sure you have a gcc installed
- run
wget -O- http://cpanmin.us | perl - --local-lib=~/perl5 App::cpanminus
- add
~/perl5/bin to your path
- install
Math::BigInt into your home directory with cpanm --local-lib=~/perl5 Math::BigInt
- add
use lib "$ENV{HOME}/perl5"; to the start of your script so it can find the new modules