I'm trying to use Net::SCP::Expect because I'm using a password as opposed to a key in SCP.
My code is fairly straightforward:
Unfortunately this is producing the following error:
Line 186 of Expect.pm is as follows:
The error suggests that I'm not loading Expect.pm or it's failing to initialise fully, I copied the source for Expect.pm from here:
If you can help in any way whatsoever I'd be really grateful, I'm running this under ActiveState's port of Perl 5.8 on Windows XP.
Rob Waite
My code is fairly straightforward:
Code:
#!c:\Perl\bin\perl.exe
# Rob Waite 10/2004
# Program to automate the process of SCP'ing Descriptions and photos to hi3
use strict;
use warnings;
use Net::SCP::Expect;
use lib "c:/tmp/LIB";
require "funcs.pl";
my $source = "c:/tmp/LIB/test.txt";
my $destination = "/home/Arob";
my $scpe = Net::SCP::Expect->new(host=>'host', user=>'user', password=>'****') || die "ERROR: Unable to log in\n";
$scpe->scp($source, $destination) || die "ERROR: File-upload error";
Code:
Can't locate object method "new" via package "Expect" (perhaps you forgot to load "Expect"?) at C:/Perl/site/lib/Net/SCP/Expect.pm line 163.
Code:
my $scp = Expect->new;
If you can help in any way whatsoever I'd be really grateful, I'm running this under ActiveState's port of Perl 5.8 on Windows XP.
Rob Waite