in reply to Re: Causing discord between Net::FTP and IO::Sockets
in thread Causing discord between Net::FTP and IO::Sockets

zwon,

Thanks for helping me think around this problem. I looked at all the @ISA = statements and require statements and saw exactly what you described.

Adding use IO::Socket::INET; to my code did not fix the problem but fortunately I had already stumbled across the answer.

In trying to execute your quick check on my platform I accidentally typed in the following:

perl -MNet::FTP -MIO::Socket::INET -e 'print Net::FTP::A->can("new") || "can not", "\n"'

and was surprised to get the answer

can not

Notice that I had omitted the ::A in the first -M switch. When I corrected the check to be exactly as you typed it, I got the expected result. Adding use IO::Socket::INET; to the existing code made it just like the mistyped check. That is, using the packages Net::FTP and IO::Socket::INET but not explicitly using Net::FTP::A.

So, by adding the two lines:

use Net::FTP::A; use IO::Socket::INET;
to my code I avoided the runtime error.


Thanks,
Cefu

P.S. I'm still confused as to why something I'm doing during processing could selectively trigger this behavior. Is this a bug that I should report to the Net::FTP author or am I doing something extraordinary to trigger this condition?

Replies are listed 'Best First'.
Re^3: Causing discord between Net::FTP and IO::Sockets
by zwon (Abbot) on Jan 27, 2009 at 19:49 UTC

    It would be great if you show how to reproduce problem. Then I think it would be clear if it's a bug in Net::FTP or in your code.