Hi, I am getting Can't locate object method "new" via package "Net::FTP::A" at /usr/perl5/5.00503 /sun4-solaris/IO/Socket.pm line 253. error when I try to put a file on the FTP server. This is a new install of Net::FTP and since I am behind the corp firewall I had to install the Net::FTP, Cmd.pm and Config.pm by downloading and cp the files to the local perl_lib folder. Here is the Debug trace and the code. I saw plenty of posting on the net with this problem, but no solutions. Thanks.

Debug Trace

-> perl -w ftp_files.pl Net::FTP>>> Net::FTP(2.71) Net::FTP>>> Exporter Net::FTP>>> Net::Cmd(2.24) Net::FTP>>> IO::Socket::INET Net::FTP>>> IO::Socket(1.1603) Net::FTP>>> IO::Handle(1.1505) Net::FTP=GLOB(0x5dde8)<<< 220 Microsoft FTP Service (Version 5.0). Net::FTP=GLOB(0x5dde8)>>> user test Net::FTP=GLOB(0x5dde8)<<< 331 Password required for test. Net::FTP=GLOB(0x5dde8)>>> PASS .... Net::FTP=GLOB(0x5dde8)<<< 230 user test logged in. Net::FTP=GLOB(0x5dde8)>>> CWD test Net::FTP=GLOB(0x5dde8)<<< 250 CWD command successful. Net::FTP=GLOB(0x5dde8)>>> ALLO 35 Net::FTP=GLOB(0x5dde8)<<< 200 ALLO command successful. Net::FTP=GLOB(0x5dde8)>>> PORT 10,208,8,134,156,192 Net::FTP=GLOB(0x5dde8)<<< 200 PORT command successful. Net::FTP=GLOB(0x5dde8)>>> STOR ndm_rpt_133.csv Net::FTP=GLOB(0x5dde8)<<< 150 Opening ASCII mode data connection for n +dm_rpt_133.csv. Can't locate object method "new" via package "Net::FTP::A" at /usr/per +l5/5.00503 /sun4-solaris/IO/Socket.pm line 253.

Code

use lib '/opt/autotree/autouser/perl_lib'; # Location of Net::FTP use strict; use Net::FTP; my $ftp = Net::FTP->new($ftp_server, Timeout => 30, Debug => 1) or die "Error: Cannot connect to FTP server $ftp_server $@\n"; $ftp->login($ftpid, $ftppwd) or die "Error: FTP Login Failed $@\n"; $ftp->cwd($ftp_file_dir) or die "Error: Unable to change to directory $ftp_file_dir $@\n"; $ftp->put($file) or die "Error: Cannot $ftp_cmd file $ftp_file $@\n"; $ftp->quit() or warn "Could not quit ftp session gracefully\n"; </p>

In reply to Net::FTP Error by cutter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.