[Ssh-sftp-perl-users] scp_get error, "stat is not of type HVptr", line 317 in Net/SSH2.pm
Brought to you by:
dbrobins
From: Len, C. <CL...@sj...> - 2009-11-09 18:39:35
|
Hello, I installed Net::SSH2 v0.28 on top of a i386-Linux perl v5.6.1 distribution, with supporting libgcrypt-1.1.12 and libssh2-1.2.1 C libraries. "make test" passed (albeit 65/75 skipped for "various reasons") at install time. (Test-Simple-0.94, Test-Harness-2.64, and ExtUtils-MakeMaker-6.4.2 were also installed for purposes of ensuring successful "make test" run) During use, login attempts via SSH2 into my remote server are successful, as are directory listings. But I get this error when attempting to create the IO object, for a SCP get file transfer: "stat is not of type HVPtr at /usr/local/lib/perl/5.6.1/Net/SSH2.pm line 317". I have tried updating IO (containing ::File) to latest v1.2.5 (suspecting old version incompatibility), it did not help. My test code is below my signature, based on an excerpt taken from http://www.perlmonks.org/?node_id=569657 Any help would be appreciated! Thank you, Chris Len St. Jude Medical <http://www.sjm.com/> cl...@sj... <mailto:cl...@sj...> #!/usr/bin/perl use warnings; use strict; use Net::SSH2; use IO::File; my $ssh2 = Net::SSH2->new(); $ssh2->connect('myhost.mydomain') or die "Unable to connect Host $@ \n"; $ssh2->auth_password('myuser','mypass') or die "Unable to login $@ \n"; print("Logged in successfully, attempting file listing\n"); my $sftp = $ssh2->sftp(); my $dir1 = '/tmp/'; my $dh = $sftp->opendir($dir1); while(my $item = $dh->read) { print $item->{'name'},"\n"; } print("List successful, attempting file download \n"); my $remote1 = '/tmp/big100mb.file'; #FAILURE AT BELOW LINE my $local1 = IO::File->new("> /tmp/download.file"); $ssh2->scp_get($remote1, $local1); This communication, including any attachments, may contain information that is proprietary, privileged, confidential or legally exempt from disclosure. If you are not a named addressee, you are hereby notified that you are not authorized to read, print, retain a copy of or disseminate any portion of this communication without the consent of the sender and that doing so may be unlawful. If you have received this communication in error, please immediately notify the sender via return e-mail and delete it from your system. |