Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a question that has probably been plowed under long ago, but I have much farther to go than the wise monks... To wit:

I have inherited some pretty basic scripts that performed FTP successfully under perl5.003. Upon getting the local sys admins to upgrade to 5.6.1 and update Net::FTP, the same scripts won't connect and inform me (in $@) that "Net::FTP: Timeout" is as far as I'm going to go. Syntax checks, -w, strict all apply. Applying various options to the constructor change nothing. The system is a fairly dusty DG/UX. All suggestions (that don't require self-flagellation) will be humbly considered.
  • Comment on Older versions of Net::FTP work -- 5.6.1 doesn't

Replies are listed 'Best First'.
Re: Older versions of Net::FTP work -- 5.6.1 doesn't
by tachyon (Chancellor) on Aug 15, 2001 at 04:36 UTC

    There has probably been a change on your system above and beyond what you note (a firewall perhaps?) that has broken your script although it could relate to changes in Net::FTP interface. Hard to say without any code or what version you were using and now have. If you check out the Net::FTP docs you will find:

    CONSTRUCTOR new (HOST [,OPTIONS]) This is the constructor for a new Net::FTP object. HOST is the name of + the remote host to which a FTP connection is required. OPTIONS are passed in a hash like fashion, using key and value pairs. +Possible options are: Firewall - The name of a machine which acts as a FTP firewall. This ca +n be overridden by an environment variable FTP_FIREWALL. If specified +, and the given host cannot be directly connected to, then the connec +tion is made to the firewall machine and the string @hostname is appe +nded to the login identifier. This kind of setup is also refered to a +s a ftp proxy. Port - The port number to connect to on the remote machine for the FTP + connection Timeout - Set a timeout value (defaults to 120) Debug - debug level (see the debug method in the Net::Cmd manpage) Passive - If set to a non-zero value then all data transfers will be d +one using passive mode. This is not usually required except for some +dumb servers, and some firewall configurations. This can also be set +by the environment variable FTP_PASSIVE. If the constructor fails undef will be returned and an error message w +ill be in $@

    If you then check out the Net::Cmd docs you will see that setting the degug level to true should direct a full transaction log to STDERR giving you details of the problem more enlightening than the timout error you get currently from $@. With the cause of the timeout then evident a solution should be easier to find.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Older versions of Net::FTP work -- 5.6.1 doesn't
by kschwab (Vicar) on Aug 15, 2001 at 05:00 UTC
    It's really hard to say, without having more info.

    One idea: Perhaps you are behind a firewall, and the administrators failed to put the right firewall settings in Net::Config. These things are usually set when libnet ( which contains both Net::FTP and Net::Config ) is installed.

    Another Idea: Try calling Net::FTP->new() with the Debug option on. Or even running your script through the debugger.

    Good luck.

Re: Older versions of Net::FTP work -- 5.6.1 doesn't
by graq (Curate) on Aug 15, 2001 at 13:04 UTC
    Further to the above suggestions. Try changing the connection string to localhost (127.0.0.1) and ftp to the host machine. Further use of traceroute and ping, as well as performing the ftp conection manually, may help you garner more information.

    But the best suggestion really is to have as much debugging as possible.

    This problem may be more of an unix administration problem than a Perl problem. If it is Perl, then some relevant code could help.

    --
    Graq