develooper Front page | perl.perl5.porters | Postings from May 2012

[perl #113390] Net::FTP notice read() error on local file

Kevin Ryde
May 26, 2012 16:44
[perl #113390] Net::FTP notice read() error on local file
Message ID:
# New Ticket Created by  Kevin Ryde 
# Please include the string:  [perl #113390]
# in the subject line of all future correspondence about this issue. 
# <URL: >

In Net::FTP version 2.77, when doing a put() if there's an error from
read() it seems to be silently treated as normal eof, where I hoped it
would gives some sort of error.

I see the code notices an error from binmode(), or socket write() and
close(), and gives an undef return, but apparently not for read()

The below simulates a read error with a tied file handle.
I wonder if the $ftp->put() could return undef in this case.

Dunno if it should also carp() or $ftp->message() or whatever for such
local errors.  Carp might be orright for interactive use, but from a
program you'd prefer to get a message or something and display it in
your own way.  I suppose for compatibility any change to carp vs message
or $! etc might have to be just an option. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About