Sorry if this comes across twice. It bounced back the first time...
Would someone mind telling me what I am doing wrong here please. I am trying to tie
the SCP Expect module into a backup script I put together, but it keeps failing. I
stripped out all but the SCP example code and it still generates an error from the
module. I verified my login, directory and filenames were correct by sending the file
manually.
I am running Perl v5.8.0, Expect-1.14, and Net-SCP-Expect-0.10
#The Script
#!/usr/bin/perl -w
use strict;
use Net::SCP::Expect;
my $host = "host.whatever";
my $user = "josem";
my $pwd = "password";
my $scp = Net::SCP::Expect->new(host=>$host,user=>$user,password=>$pwd);
$scp->scp("[backup.tar]","[/home/josem]");
exit 0;
#The error
josem $./script3.pl
at /usr/lib/perl5/site_perl/5.8.0/Expect.pm line 730ease try again.
#Line 730 from Expect.pm
725 if ($#{$pattern} > 3) {
726 # call with parameters if given
727 $exp_cont = &{$pattern->[3]}($exp,
728 @{$pattern}[4..$#{$pattern}]);
729 } else {
730 $exp_cont = &{$pattern->[3]}($exp);
731 }
Any help would be greatly appreciated!
Thanks,
Jose