Laurent Coudeur wrote:
-----Original Message-----
From: Owen [mailto:[EMAIL PROTECTED]
Sent: 29 July 2005 00:07
To: beginners@perl.org
Subject: Re: error message with net::FTP
On Thu, 28 Jul 2005 10:17:35 -0400
"Laurent Coudeur" <[EMAIL PROTECTED]> wrote:
I am having some trouble with net::FTP module I get this error message
Timeout at /usr/lib/perl5/5.8/Net/FTP.pm line 1001
the script list directories in a path
then loops and list subdirectories
I can connect and list files but as I try to ls into final
sub-directory it hangs I get into the directory but cannot list
foreach (@list){
$ftp->cwd();
$ftp->cwd("$_");
my @filelist=$ftp->ls($_) or print LOG "cannot get in project
folder $_";
I wonder if your $_ is being clobbered, what happens if you try
foreach my $item(@list){
and replace all instances of $_ with $item
Thanks Owen I did that but it still does the same
I have copied the script on a linux box Here (using windows most of the
time)
The script is actually fine (I added your suggestion to be safe but same
problems still occur).
It times out only in windows and only in blank directories. In linux I
get the or message in logs
Does anybody knows of a workaround short of adding a blank file in all
directories?
I have to run this on a windows box (unfortunatly)
Laurent
So on the empty directories you get something like this:
my @filelist=$ftp->ls($_)
returns undef?
If so, you can test for that and 'next'
my @filelist=$ftp->ls($_)
next unless @filelist; # or something, it's late here.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>