Can't call method "sockport" on an undefined value

That's probably because the preceding bind/listen call failed, which in turn might be because your webserver process is not allowed to create the respective listening socket to which the FTP server (when operating in the default "active" mode) is then meant to establish a second connection to (used to transfer the data).

In other words, you could try passive mode (which is not guaranteed to work either, though). I.e.

$ftp = Net::FTP->new("ftp.xyz.com", Passive => 1, Timeout => 300, Debu +g => 1)

Quote from the docs:

FTP servers can work in passive or active mode. Active mode is when you want to transfer data you have to tell the server the address and port to connect to. Passive mode is when the server provides the address and port and you establish the connection. With some firewalls active mode does not work as the server cannot connect to your machine (because you are behind a firewall) and the fi +rewall does not re-write the command. In this case you should set ftp_ext_pas +sive to a true value.

In reply to Re: CGI/FTP Put question by almut
in thread CGI/FTP Put question by DrWho_100

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.