[EMAIL PROTECTED] wrote:

> Hi,
> 
> I am writing a small script that uses Net::FTP module to get/put a file
> to/from a FTP server running on NT.
> Everything works fine, but when I try to get the file perl gives the
> following error message:
> 
> 
>>>>Can't use string ("1") as a symbol ref while "strict refs" in use at
>>>>
> C:/Perl/site/lib/Net/FTP.pm line 474. <<<
> 
> Even the file is created localy with the length 0!
> I am using Perl 5.6.1 on NT 4.0 sp6a.
> 
> Here is the script:
> 
>---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> use Net::FTP;
> #################
> # FTP DownLoad  #
> #################
> 
> sub MyFTPDownLoad
> {
>      my ($ip,$userid,$password,$dir,$filename) = @_;
>      $ftp = Net::FTP->new($ip, Debug => 1, Hash => 1);
>      $ftp->login($userid,$password);
>      $ftp->cwd($dir);
>      $ftp->binary();
>      $ftp->get($filename,$filename);
>      $ftp->quit;
>      undef $ftp;
> }
> 
> MyFTPDownLoad('secret','secret','**********','/Dir1/Dir2','filename.zip');
> 
>---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> 
> What is the problem here? Can any body help me???
> Regards,


There's a bug in the Hash logic.  You could replace line 90:

  $ftp->hash(exists $arg{Hash} ? $arg{Hash} : 0, 1024);

with:

  $ftp->hash(exists $arg{Hash} ? (\*STDERR, 1024) : (0, 0));

to fix the module or leave Hash => 1 off your new call.

-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to