Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Uninitialized value in Net::FTP I.pm

by idnopheq (Chaplain)
on Sep 25, 2001 at 14:45 UTC ( [id://114503]=note: print w/replies, xml ) Need Help??


in reply to Uninitialized value in Net::FTP I.pm

Can you post your code, please. It becomes infinitely difficult for us to help you w/o knowing how you are using Net::FTP. Also, can you fill us in more on the environment you are ftp-ing from? When the "Files get copied OK", I take it that they are not corrupted and the line endings are correct ( I believe the I.pm module handles binary transfers )?

HTH
--
idnopheq
Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

  • Comment on Re: Uninitialized value in Net::FTP I.pm

Replies are listed 'Best First'.
Re: Re: Uninitialized value in Net::FTP I.pm
by topsik (Initiate) on Sep 25, 2001 at 17:58 UTC
    Sorry for being non specific. In the meantime I have
    created a simplified version of the script that
    produces the same error. Here it goes:

    #!/app/ecb/perl/bin/perl -w use Net::FTP; $FTP_HOST="machine"; $FTP_USER="ftp"; $FTP_PASSWORD="ftp"; $FTP_SRC_FILENAME="pub/src_file"; $FTP_DST_FILENAME="./results"; $ftp= new Net::FTP( ${FTP_HOST} ); $ftp->login( ${FTP_USER}, ${FTP_PASSWORD} ); $ftp->binary; $ftp->get( ${FTP_SRC_FILENAME}, ${FTP_DST_FILENAME}); $ftp->quit; # End of script
    Machine that I'm ftping from:
    SunOS 4.1.3_U1 1 sun4m

    Machine to which transfer goes:
    SunOS 5.7 Generic_111437-01 sun4u sparc SUNW,UltraSPARC-IIi-cEngine

    And yes, I.pm handles binary transfers. Actually exactly
    the same error occurs for ascii transfers, but in A.pm.
    The line at which it fails in both cases reads:
    $blksize = $size if $size > $blksize;

    And the perl version (from perl -V) is:
    perl5 (revision 5.0 version 6 subversion 0)

    The result files are perfect.

    topsik
      You are using the -w switch after your #! line which turns warnings on. The error message you are getting is just a warning rather than being something fatal (which is why your files are still being transfered).

      If you don't want to see it the fastest and easiest thing is to just remove the -w. I don't know of anyway to leave warnings on and not get them for the Net::Ftp module.
      I don't know what could be happening. Either size or blksize is undefined (if your line number is correct), and coming into the subroutine there's this line:
      my $size = shift || croak 'read($buf,$size,[$timeout])';
      So the script should die if size is undefined, and blksize is set when you create the ftp object, and you don't seem to be changing blksize anywhere. What version of Net::FTP do you have? Though it seems unnecessary on such a short script, my only advice is use strict and warnings, at least on the larger script this script comes from, and maybe step through with the perl perldebugger.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://114503]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-12-03 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found