Strange. It all just works here in passive mode, and the non-passive case is explainable. When I add the following print to your code, i get the %eth0:
my $ftp = Net::FTP->new($ipaddr, Debug=>1, Passive=>1) or die "Can't c
+onnect: $@\n";
print $ftp->sockhost;
I'm guessing by this point it's already missing for you? Using Net::FTP 3.02 and IO::Socket::INET is 1.35 here.
As a digression, my ifconfig shows a scope id of "2" for my eth0 device. When I then use %2 at the end of the ip address, Net::FTP automatically replaces it with %eth0. While that's new to me, it's obviously supported. However Net::FTP violates RFC 2428 by including that in the EPRT command in the non-passive case. I had to do rule rewriting in my Proftpd server to strip it off before things would work.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|