libwww-perl-5 and ftp mode

Paul Schinder (schinder@pjstoaster.pg.md.us)
Fri, 05 Jul 96 17:51:41 -0500


I had some time this long weekend to get libwww-perl-5.00 working under
the alpha of MacPerl which brings MacPerl up to 5.002.  I'll post a
message later with the gory details (actually very few changes need to
be made) after I've had a chance to test everything out, but I've been
able to make both ftp and http requests succesfully.

One question about ftp mode.  I grabbed a file which LWP decided to
download binary.  After the data was collected, we come to (around line
149; my line numbers might be slightly different at this point from the
distribution and I don't have a pristine copy available):

    if ($data->close != 2) {

which, if I've followed the code in Net::FTP properly gets its value
 from the following line in Net::FTP::dataconn::close

 $ftp->status == CMD_OK;

How can $data->close ever be 2?  (I realize CMD_OK is 2, but perlop
says that == returns true or false.  Is it guaranteed that == returns
the actual value if true?)  I changed this in my copy to
unless($data->close), and that seems to work, but I'm not sure if this
the the right way to deal with the problem.  As originally written, the
file is downloaded exactly but LWP complains and is_success is false.
I believe I have the latest  versions of both Net::FTP (from
libnet-1.00) and libwww-perl-5.00.
---
--------
Paul J. Schinder
NASA Goddard Space Flight Center,
Code 693, Greenbelt, MD 20771 USA
schinder@pjstoaster.pg.md.us