It would be easier to help if you posted an entire script, or a reduced test case that illustrates the problem. Barring that, I would think that a timeout would occur when you construct the ftp connection, not when you issue dir(). If you invoke the connection as described in Net::FTP you should get an error message when the connection fails. You can also include Debug=>1 to have more information printed to stderr.
my $ftp = Net::FTP->new($hostname,Debug=>1)
or die "Cannot connect to $hostname: $@";
Update:Although I might think that the timeout would occur at construction, I am apparently wrong. Sorry. With the updated information posted below and your code, it appears the problem is different that I had initially thought.
-
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.
|