Looking at the module source I can not see how that error can happen at that line when using version 1.67.

Can you run on the debugger...

Code

x $Net::SFTP::Foreign::VERSION

...to ensure that you are actually using that version.

Or have you changed the module yourself? (this may look like a silly question, but it has happened to me on the past, some user changing the module and then filling a bug report because it didn't worked!, so I have to ask :-)

I will ask for what OS and sftp server the other side is running, it might take a day or so before I can get a reply though. I'll get back as soon as I can!

Edit: When I've stepped through the program in the debugger, it does output the error message after line 1561 ($n++;), but I guess it checks the while statement on line 1554 to do it. I don't understand why $size is considered uninitialized at that time.

Hi again, sorry about the late reply. I haven't received a reply yet regarding the software unfortunately. When I try to telnet to the server I get this:

SSH-2.0-GXSSSHD_Comments

When I set the debug = -1 I get a lot of debug output (more than my max allowed buffer size here...). Here is the output from where the $sftp-mget command runs (i have edited paths and filenames in the output manually here, hope that doesn't mess up readability):

Trying to install through cpan or ActiveState ppm still shows module version 1.67. Can I unzip the module from your link and just drop the new SFTP folder with contents to C:\Perl\site\lib\Net\SFTP replacing the previous version?