ChrisR has asked for the wisdom of the Perl Monks concerning the following question:
Line 92 is:Unable to close datastream at script.pl line 92
The only problem caused by this is emotional distress because I don’t have any idea what I might be doing wrong to cause this warning. Here is a small snippet of the code:$ftpmsg = $ftp->get($listing{$x}[$y][0],"/$path1/$path2/$x/$listing{$x +}[$y][0]");
Any information would be greatly appreciated.… $ftp = Net::FTP->new("ftp.nai.com", Debug => 0) or die "Cannot connect + to ftp.nai.com: $@\n"; $ftp->login("anonymous","user\@domain.com") or die "Cannot login to ft +p.nai.com: " . $ftp->message . "\n"; $ftp->binary() or die "Cannot change to binary data format: ". $ftp->m +essage() . "\n"; … $counter = 0; do { $counter++; $ftpmsg = $ftp->get($listing{$x}[$y][0],"/$path1/$path2/$x +/$listing{$x}[$y][0]"); } until ($ftpmsg eq "/$path1/$path2/$x/$listing{$x}[$y][0]" || + $counter >= 10); …
Since it uses carp instead of croak, I'm pretty sure that this is a warning and not an error. However, I'm still not quite sure what this means. It appears to me, a relative novice, that the file was downloaded but since the connection could not be closed, the routine returns undef which tells me the download failed even though the file is probably intact. Is there a way to fix this or do I just have to learn to live with it?unless ($data->close()) # implied $ftp->response { carp "Unable to close datastream"; return undef; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unable to close datastream
by diakonos (Hermit) on Jun 29, 2004 at 19:13 UTC |