You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by peng wei <cn...@gmail.com> on 2010/11/08 03:35:12 UTC

I am facing one real question

Hi All,

I don't think this is in the range of FAQ, so I write this mail to ask for help.

Thanks all in advance.


Situation description:

1. There is one ftp server, there is one folder called map_files on it.

2. The objective of my perl script is fetch the files down from this
ftp server, which all located int the map_files folder.

3. Below warning was encounted:
Can't use an undefined value as a symbol reference at
C:/Perl/lib/Net/FTP/dataconn.pm line 54.

4. I have searched all google, can not find any useful infomation.

my scrip like below:

sub getmap_FTP1()
{
    $hostname2 = "ftp.abc.com.tw";
    $username2 = "abc";
    $password2 = "abc";
    $remopath2 = "/abc/def";

    $ftp = Net::FTP->new($hostname2, Debug => 0, Port => 21,Timeout => 1240);
    chdir($LocalPath);
    if($ftp->login($username2, $password2))
    {
  		if ($ftp->cwd($remopath2))
  		{
  			print "change remote work directory succeed \n";
        		$ftp->binary;
			foreach $lot_file(@map_files)
			{	
		          @files = $ftp->ls($lot_file."*");
		          if (scalar(@files)>0)
		          {
			          foreach $each_file(@files)
			          {
			          	  print "fetching-->";
				          $ftp->get($each_file);
			                  print $each_file."\n";
				}
			    }
		  	}
		  }
      }
 $ftp->close;
}

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: I am facing one real question

Posted by Vick Khera <kh...@kcilink.com>.
On Nov 7, 2010, at 9:35 PM, peng wei wrote:

> 3. Below warning was encounted:
> Can't use an undefined value as a symbol reference at
> C:/Perl/lib/Net/FTP/dataconn.pm line 54.
> 
> 4. I have searched all google, can not find any useful infomation.
> 

Can you make this script work outside of mod_perl? (Hint: this is not a mod_perl problem, it is your perl code's problem.)

Also, where is your error checking for return values from the new() method?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org