Re: libwww-perl-5 and ftp mode
Graham Barr (bodg@tiuk.ti.com)
Mon, 8 Jul 96 09:43:26 BST
Paul Schinder <schinder@pjstoaster.pg.md.us> writes:
>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.
This was a change introduced into Net::FTP along with Net::Cmd. It seems
to have slipped through being noted in the ChangeLog, sorry :-(
the lwp code needs to be changed to
unless ($data->close) {
Graham
--
Graham Barr <bodg@tiuk.ti.com> | There is no ultimate answer.
Texas Instruments Ltd. | Only more revealing ways
| of looking at the question.