Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Perl / May 2004



Tip: Looking for answers? Try searching our database.

Problems with LWP::UserAgent and Net::FTP  

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dr . John Keating - 17 May 2004 18:44 GMT
Hi,

I've been using the CPAN module to install stuff for some time now and
it always ends up using the 'ftp -n' option as
the modules LWP and Net don't appear to be working. Has anyone else
noticed this? There is a sample output at the
end of the message. I'm getting the following errors when I use the
Net::FTP module directly. It appears to be problematic
in the retrieve section. I've re-installed, etc and have found that
CPAN thinks it is fine. Any help would be great thanks!

Net::FTP>>> Net::FTP(2.74)
Net::FTP>>>   Exporter(5.567)
Net::FTP>>>   Net::Cmd(2.25)
Net::FTP>>>   IO::Socket::INET(1.26)
Net::FTP>>>     IO::Socket(1.27)
Net::FTP>>>       IO::Handle(1.21)
Net::FTP=GLOB(0x88b6e8)<<< 220 siobhra.indigo.ie FTP server (Version
6.00) ready.
Net::FTP=GLOB(0x88b6e8)>>> user anonymous
Net::FTP=GLOB(0x88b6e8)<<< 331 Guest login ok, send your email address
as password.
Net::FTP=GLOB(0x88b6e8)>>> PASS ....
Net::FTP=GLOB(0x88b6e8)<<< 230 Guest login ok, access restrictions
apply.
Net::FTP=GLOB(0x88b6e8)>>> CWD /pub/CPAN/authors/id/I/IL/ILYAM
Net::FTP=GLOB(0x88b6e8)<<< 250 CWD command successful.
Net::FTP=GLOB(0x88b6e8)>>> PORT 149,157,245,23,219,60
Net::FTP=GLOB(0x88b6e8)<<< 200 PORT command successful.
Net::FTP=GLOB(0x88b6e8)>>> RETR HTTP-WebTest-2.04.tar.gz

The program hangs at the last line then times out. I've not had this
problem before on other systems - it is getting to me now. I'm using
the
folowing version of Perl:

This is perl, v5.8.1-RC3 built for darwin-thread-multi-2level
(with 1 registered patch, see perl -V for more detail)

It looks like the problem is really in the IO::Socket module so I tried
to force a re-installation of that and got the following:

Checking for Socket...ok
Checking if your kit is complete...
Looks good
Writing Makefile for IO
cp IO/File.pm blib/lib/IO/File.pm
cp IO/Select.pm blib/lib/IO/Select.pm
cp IO/Socket/INET.pm blib/lib/IO/Socket/INET.pm
cp IO/Socket/UNIX.pm blib/lib/IO/Socket/UNIX.pm
cp IO/Dir.pm blib/lib/IO/Dir.pm
cp IO/Pipe.pm blib/lib/IO/Pipe.pm
cp IO.pm blib/lib/IO.pm
cp IO/Handle.pm blib/lib/IO/Handle.pm
cp IO/Socket.pm blib/lib/IO/Socket.pm
cp IO/Poll.pm blib/lib/IO/Poll.pm
cp IO/Seekable.pm blib/lib/IO/Seekable.pm
/usr/bin/perl /System/Library/Perl/5.8.1/ExtUtils/xsubpp  -typemap
/System/Library/Perl/5.8.1/ExtUtils/typemap  IO.xs > IO.xsc && mv
IO.xsc IO.c
cc -c   -g -pipe -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -I/usr/local/include -Os   -DVERSION=\"1.20\"
-DXS_VERSION=\"1.20\"  
"-I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE"  
-DI_POLL  IO.c
IO.xs: In function `XS_IO__Seekable_getpos':
IO.xs:201: warning: passing arg 2 of `PerlIO_getpos' from incompatible
pointer type
IO.xs:208: error: `sv_undef' undeclared (first use in this function)
IO.xs:208: error: (Each undeclared identifier is reported only once
IO.xs:208: error: for each function it appears in.)
IO.xs: In function `XS_IO__Seekable_setpos':
IO.xs:219: warning: passing arg 2 of `PerlIO_setpos' from incompatible
pointer type
IO.xs: In function `XS_IO__File_new_tmpfile':
IO.xs:252: error: `sv_undef' undeclared (first use in this function)
make: *** [IO.o] Error 1
  /usr/bin/make  -- NOT OK

HERE ... is the output from CPAN for a general module installation ...
you can see how it gets annoying!!

Running install for module Exporter
Running make for N/NW/NWCLARK/perl-5.8.4.tar.gz
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/authors/id/N/NW/NWCLARK/perl-5.8.4.tar.gz
LWP failed with code[404] message[File 'perl-5.8.4.tar.gz' not found]
Fetching with Net::FTP:
  ftp://ftp.perl.org/pub/CPAN/authors/id/N/NW/NWCLARK/perl-5.8.4.tar.gz
Couldn't fetch perl-5.8.4.tar.gz from ftp.perl.org
Issuing "/usr/bin/ftp -n"
Connected to ftp.cpan.ddns.develooper.com.
220 siobhra.indigo.ie FTP server (Version 6.00) ready.
331 Guest login ok, send your email address as password.
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
Local directory now
/Users/jkeating/.cpan/sources/authors/id/N/NW/NWCLARK
250 CWD command successful.
250 CWD command successful.
250 CWD command successful.
250 CWD command successful.
250 CWD command successful.
250 CWD command successful.
250 CWD command successful.
250 CWD command successful.
200 Type set to I.
local: perl-5.8.4.tar.gz remote: perl-5.8.4.tar.gz
500 'EPSV': command not understood.
227 Entering Passive Mode (194,125,133,8,231,194)
150 Opening BINARY mode data connection for 'perl-5.8.4.tar.gz'
(12094233 bytes).
100% |*************************************| 11810 KB  244.11 KB/s    
00:00 ETA
226 Transfer complete.
12094233 bytes received in 00:48 (244.08 KB/s)
221 Goodbye.
Sherm Pendley - 18 May 2004 02:58 GMT
On May 17, 2004, at 1:44 PM, Dr. John Keating wrote:

> Net::FTP=GLOB(0x88b6e8)<<< 230 Guest login ok, access restrictions
> apply.
[quoted text clipped - 3 lines]
> Net::FTP=GLOB(0x88b6e8)<<< 200 PORT command successful.
> Net::FTP=GLOB(0x88b6e8)>>> RETR HTTP-WebTest-2.04.tar.gz

I don't see anything in the above about setting passive mode. Are you
behind a firewall? If so, you might need to set passive mode by
exporting a non-zero value in the FTP_PASSIVE environment variable.
(See the Net::FTP docs for more).

Also - have you tried a different mirror site?

> It looks like the problem is really in the IO::Socket module so I
> tried to force a re-installation of that and got the following:

IO::Socket is a core module; it's not really intended to be upgraded
separately. I'm curious about how you even got as far as you did - I
don't see a separate package for IO::Socket on CPAN.

> HERE ... is the output from CPAN for a general module installation ...
> you can see how it gets annoying!!
>
> Running install for module Exporter
> Running make for N/NW/NWCLARK/perl-5.8.4.tar.gz

That's not a module you're trying to install, it's a newer version of
Perl. The CPAN shell is *not* a good way to upgrade to a newer Perl.

sherm--
Dr. John Keating - 18 May 2004 11:05 GMT
Hi Sherm,

Thanks for the reply. We're not behind a firewall at all - but I'll try
that option. I used CPAN to force a make on IO just to see what
happened - when I tried to d/l a recent version of IO, etc. I got the
message about it sitting in Perl 5.8.4. I downloaded it and compiled
perl that way just for the fun actually but I didn't replace my current
installation so I'm still with 5.8.1 (I have the Mac Developer Guide
for a new installation). The Net::FTP issue is happening on both of my
machines - I'll look at the Passive option.

Thank you, John.

> On May 17, 2004, at 1:44 PM, Dr. John Keating wrote:
>
[quoted text clipped - 30 lines]
>
> sherm--

Dr. John G. Keating
Senior Lecturer
Department of Computer Science
National University of Ireland, Maynooth
Maynooth, Co. Kildare, IRELAND.

Email:    john.keating@may.ie
Tel:        +353 1 708 3854
FAX:        +353 1 708 3848
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.