in reply to Net::SSH2 fails for scp_get method

Hi, I was just checking this out, and although this node is old, for the benefit of people searching, here is how to do it. In your case, scp_get needs a blessed reference to write to, like an IO::File or IO::Scalar object. You just can't specify the file. Below is a working example
#!/usr/bin/perl use warnings; use strict; use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->debug(1); $ssh2->connect('localhost') or die "Unable to connect Host $@ \n"; $ssh2->auth_password('z','ztester') or die "Unable to login $@ \n"; my $dir = '/home/z'; #get a large file like a 100Meg video file my $remote1 = $dir.'/hamps_boogie.flv'; use IO::File; my $local1 = IO::File->new("> 2.flv"); #it needs a blessed reference $ssh2->scp_get($remote1, $local1) or die "$!\n"; # be warned that you cannot have blocking set to 0 # from perldoc Net::SSH2 # blocking ( flag ) # Enable or disable blocking. Note that if blocking is disabled, # methods that create channels may fail, e.g. "channel", "SFTP", "scp_ +*".

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh