Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with Net::FTP

3 views
Skip to first unread message

Mark

unread,
Jul 21, 2004, 2:40:32 PM7/21/04
to
I recently installed the latest version of libnet (libnet-1.19) in one
of my local directories. An error is returned that states: Can't
locate object method "new" via package "Net::FTP::I" at
/usr/share/lib/perl5/irix-n32/5.00405/IO/Socket.pm line 253.

I.pm was installed in the local directory
/usr2/people/witczak/WORK/myPerl/Modules/lib/perl5/site_perl/Net/FTP/
so why can't perl find it???


When I execute my ftp test script with debug mode on, the following is
displayed (without the ip address):

This is what @INC contains:
/usr2/people/witczak/WORK/myPerl/Modules/lib/perl5/site_perl/irix-n32
/usr2/people/witczak/WORK/myPerl/Modules/lib/perl5/site_perl
/usr/share/lib/perl5/irix-n32/5.00405
/usr/share/lib/perl5
/usr/share/lib/perl5/site_perl/irix-n32
/usr/share/lib/perl5/site_perl
/usr/share/lib/perl5/sgi_perl
.


Net::FTP>>> Net::FTP(2.75)
Net::FTP>>> Exporter
Net::FTP>>> Net::Cmd(2.26)
Net::FTP>>> IO::Socket::INET
Net::FTP>>> IO::Socket(1.1603)
Net::FTP>>> IO::Handle(1.1504)
Net::FTP=GLOB(0x100145e8)<<< 220 hilton FTP server ready.
Net::FTP=GLOB(0x100145e8)>>> user mwitczak
Net::FTP=GLOB(0x100145e8)<<< 331 Password required for mwitczak.
Net::FTP=GLOB(0x100145e8)>>> PASS ....
Net::FTP=GLOB(0x100145e8)<<< 230 User mwitczak logged in.
Net::FTP=GLOB(0x100145e8)>>> CWD /studies/temp
Net::FTP=GLOB(0x100145e8)<<< 250 CWD command successful.
Net::FTP=GLOB(0x100145e8)>>> TYPE I
Net::FTP=GLOB(0x100145e8)<<< 200 Type set to I.
Net::FTP=GLOB(0x100145e8)>>> PORT xxx,xxx,xxx,xxx,x,xxx
Net::FTP=GLOB(0x100145e8)<<< 200 PORT command successful.
Net::FTP=GLOB(0x100145e8)>>> RETR foo.dat
Net::FTP=GLOB(0x100145e8)<<< 150 Opening BINARY mode data connection
for 'foo.dat' (8 bytes).
Can't locate object method "new" via package "Net::FTP::I" at
/usr/share/lib/perl5/irix-n32/5.00405/IO/Socket.pm line 253.
Attempt to free unreferenced scalar during global destruction.


The script that generates the error is below (without host and pw):

#!/usr/sbin/perl

use lib '/usr2/people/witczak/WORK/myPerl/Modules/lib/perl5/site_perl';
use Net::FTP;

print "This is what \@INC contains:\n";
foreach $item (@INC) {
print "\t$item\n";
}
print "\n\n";


$hostname = 'xxxxxx';
$userid = 'mwitczak';
$password = 'xxxxxxx';

$remoteDir = '/studies/temp';
$filename = 'foo.dat';

$ftp = Net::FTP->new($hostname,Debug=>1);
$ftp->login($userid,$password);
$ftp->cwd($remoteDir);
$ftp->binary;
$ftp->get($filename);
$ftp->quit;

Krishna News Account

unread,
Jul 21, 2004, 9:35:18 PM7/21/04
to
Mark wrote:
> I.pm was installed in the local directory
> /usr2/people/witczak/WORK/myPerl/Modules/lib/perl5/site_perl/Net/FTP/
> so why can't perl find it???

From the errors you've given, Perl *can* find Net::FTP::I ; but it just
can't find 'new' for some reason (or it's calling 'new' for some reason it
shouldn't be). I found a couple more references to this by searching
[google: net::ftp::i error] and then clicking on the 'groups' link near the
top text field. Maybe a couple of those people who originally posted their
problems figured things out and can help you.

--

Krishna Sethuraman
bogus-k...@wapacut-fake.com

Sisyphus

unread,
Jul 21, 2004, 10:37:27 PM7/21/04
to

I have a script that I run regularly which is, in essence, identical to
the one you posted. The output it produces is, in essence, identical to
the output you have provided above - except that my script runs
successfully to completion. I can see no reason for your script to fail.
Looks like you've forgotten to 'use warnings;' - that might help throw
some light on the matter.

That error regarding I.pm is a strange one. I can't see how I.pm ever
gets called or loaded - and that error message usually occurs when you
call the "new" constructor, having forgotten to load ("use") the module.

I renamed my I.pm (so that it couldn't be found) and re-ran my script
expecting to get a complaint that I.pm could not be found, but instead
got the same error as you (though a different line number in IO::Socket.pm).

What happens if you run the following script:
#!/usr/sbin/perl
use warnings;
use Net::FTP::I;

If it presents no complaint regarding the availability of Net::FTP::I
then that should confirm that perl can find Net::FTP::I.pm.

Does renaming I.pm to something else change in any way the error you
receive ?

Is there a Net::FTP::I.pm in any of the other @INC directories ?

I'm using different versions of the modules:
Net::FTP>>> Net::FTP(2.72)
Net::FTP>>> Exporter(5.58)
Net::FTP>>> Net::Cmd(2.24)
Net::FTP>>> IO::Socket::INET(1.27)
Net::FTP>>> IO::Socket(1.28)
Net::FTP>>> IO::Handle(1.24)

I don't know whether that accounts for the different behaviour we are
getting. Maybe it's a problem with your FTP server, or your OS, or the
fact that you're running such an old version of perl, or the wind
direction, or ....

Perhaps something didn't go correctly during the update ? Was there a
similar problem *before* you updated libnet ?

Cheers,
Rob

--
To reply by email u have to take out the u in kalinaubears.

0 new messages