Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net::SCP::Expect problem

Status
Not open for further replies.

waiterm

Programmer
May 17, 2004
236
GB
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:
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";
Unfortunately this is producing the following 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.
Line 186 of Expect.pm is as follows:
Code:
    my $scp = Expect->new;
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
 
Have a look at $! in your die statement

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Hi Mike,

Unfortunately it doesn't produce the die statement because it dies before it reaches it. I think the problem is with a dodgy install of Expect, I've had problems with its pre-requisites in the past (IO::Tty and IO::pty). Do you have any idea how these are structured and stored in the Perl/lib directory? This may help solve the problem so that I can get a clean instal of Expect in CPAN.

Thanks in advance.

Rob Waite
 
No Rob, sorry. You installing expect using ppm? You might try un-installing and re-installing if so (not very helpful I know)

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Code:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\User>ppm
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState SRL. All Rights Reserved.

Entering interactive shell. Using Term::ReadLine::Stub as readline library.

Type 'help' to get started.

ppm> s expect
Searching in Active Repositories
No matches for 'expect'; see 'help search'.

Rob Waite
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top