I keep getting this error when I call: $ftp->move("$nick.bak","$nick") or die $ftp->message;
Use of uninitialized value $t in length at C:/camelbox/site/lib/Net/FT +P/File.pm line 128. Thread 2 terminated abnormally: write($buf,$size,[$timeout]) at C:/cam +elbox/site /lib/Net/FTP/File.pm line 128 thread 2
I am not sure what is going on here. The variable $nick is correct and print $ftp->pwd(),"\n"; return a correct value. Any ideas?

Below I also included the subroutine in the program that uses this call, just in case.

sub ftp{ my @list; my $new_dir2; my $count = 0; my $dir = cwd; my @new_dir1 = split('/',$dir); foreach my $kid (@new_dir1){ $new_dir1 .= "$kid\\"; $new_dir2 .= "$kid\\"; } $new_dir1 .= "gps"; $new_dir2 .= "icons"; $img_met = "$new_dir2\\met.png"; $img_spoton = "$new_dir2\\spoton.png"; $img_spotoff = "$new_dir2\\spotoff.png"; $img_spotdis = "$new_dir2\\spotdis.png"; $|++; while(1) { if ( $die == 1 ){ goto END }; #~ print "$sftp_start\n"; if ( $sftp_start == 1) { my $ftp = Net::FTP->new("updraft.unl.edu", Passive => 0) o +r $error = 1; if (defined($ftp)){ if ($special == 1){ $special = 2; } $ftp->login("*****",'*****') or $error = 1; eval{$ftp->cdup or $error = 1;}; eval{$ftp->cwd($gps_remote) or $error = 1;}; for (;;) { #~ print "HERE1\n"; if ($gps_ready == 1){ eval{$ftp->put("$new_dir1\\$nick","$nick.bak") + or $error = 1;}; #~ HERES the Problem eval{$ftp->move("$nick.bak","$nick") or print +$ftp->message,"\n";}; #~ $ftp->move("$nick.bak","$nick") or die $ftp +->message; $gps_ready = 0; } eval{@list = $ftp->ls($ftp->pwd()) or $error = 1;} +; foreach my $kid (@list){ my $nkid; $nkid = substr($kid,28,5); if (defined($nkid )){ next if $kid eq "."; next if $kid eq ".."; next if $kid =~ /\.bak$/; next if $kid eq $nick; eval{$ftp->get($nkid,"$new_dir1\\$nkid.bak +") or $error = 1;}; } } # signal to create pf $gps_to_pf = 1; sleep 1; $sftp_start = 0 if $error == 1; if($sftp_start == 0){ last}; if($die == 1){ goto END }; } $ftp->quit; } else{ $sftp_start = 0; } } elsif ($sftp_start == 0 and $gps_start == 1){ sleep 1; $gps_to_pf = 1; $count++; print "Reconnecting...\n"; if ($count == 10){ $sftp_start = 1; $count = 0; $special = 1; } } else { sleep 1 } } END: }

In reply to Error during Net::FTP::FILE::move by deadpickle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.