Use of uninitialized value $t in length at C:/camelbox/site/lib/Net/FTP/File.pm line 128. Thread 2 terminated abnormally: write($buf,$size,[$timeout]) at C:/camelbox/site /lib/Net/FTP/File.pm line 128 thread 2 #### 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) or $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: }