Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

About Net:FTP:Autoreconnect

by cnarun86 (Initiate)
on Mar 07, 2009 at 10:20 UTC ( #749030=perlquestion: print w/ replies, xml ) Need Help??
cnarun86 has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

I using Net:FTP:Autoreconnect to connect to FTP server and download the files. The program works fine for sometimes. But sometimes it shows the error

Can't use an undefined value as a symbol reference at /usr/lib/perl5/5.10.0/Net/FTP/dataconn.pm line 54.

My program is good there is no flaws in it. I am sure. Is it a bug in the module?

Waiting for the bless

Arun Kumar C.N

Comment on About Net:FTP:Autoreconnect
Re: About Net:FTP:Autoreconnect
by Anonymous Monk on Mar 07, 2009 at 10:37 UTC
    My program is good there is no flaws in it. I am sure. Is it a bug in the module?
    You may wish to re-evaluate how you define being sure.
    sub _close { my $data = shift; my $ftp = ${*$data}{'net_ftp_cmd'}; $data->SUPER::close(); delete ${*$ftp}{'net_ftp_dataconn'} ################# LINE 54 if exists ${*$ftp}{'net_ftp_dataconn'} && $data == ${*$ftp}{'net_ftp_dataconn'};
    $ perl -MNet::FTP -MNet::FTP::dataconn -le ' Net::FTP::dataconn->new-> +close ' Can't use an undefined value as a symbol reference at /usr/lib/perl5/5 +.10.0/Net/FTP/dataconn.pm line 54.
      Thanks for the reply

      My program runs successfully for most of the times. If there is any error in the program then how it is running successfully.

      This error will occur rarely but fatal.It occurs(mostly) while using ls command as follows

      my @ftpfiles=$ftp->ls or die "cannot get file list; print "Got file list\n";
      It is also not printing the statement in the die. Whats the problem?

      Waiting for the bless

      Arun Kumar C.N

        It is also not printing the statement in the die. Whats the problem?
        Then obviously this isn't where your program is dying. Have you used the debugger? Used print statements or Data::Dumper calls judiciously?

        If the problem occurs with any regularity (as you say it does), it's deterministic.

Re: About Net:FTP:Autoreconnect
by zwon (Monsignor) on Mar 07, 2009 at 19:28 UTC
      Hello,

      Thanks for the reply

      So including the following lines in my program will fix my problem?

      use Net::FTP::A; use IO::Socket::INET;

      There is no regularity in the error. It is arising rarely.

      Arun Kumar C.N

        So including the following lines in my program will fix my problem?

        Not sure. But if it will, let us know ;)

Re: About Net:FTP:Autoreconnect
by Anonymous Monk on Dec 01, 2012 at 23:25 UTC
    I am having the same issue, but only on windows 7 machine and occurs when i am trying to pull a file from FTP server but for some reason the file is not present in the server. $ftp->get("$file1") or warn "Get failed ", $ftp->message; on windows xp machine though it just pint the warning message and the script carries on. both have perl version 5.10.0

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://749030]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2014-08-22 13:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (158 votes), past polls