the first time the files are uploaded everything works fine. when it uploads a second time...
If the files have been uploaded and moved the "first time", how is it possible that they come into play a "second time"?
If you really are looping over @FileList only once (as I suspect you should be), then there should be no problem -- though a better approach might be (untested code here):
If you are going through this list a second time for some other reason, then of course, having set the array elements to undef will cause the error report when you pass the empty elements as part of a string for the FTP->put().my $src = "p:/charts/Sendtray/"; my $dst = "p:/charts/Sendtray/GONE/"; while (@FileList) { my $oFile = shift @FileList; $oFTP->put("$src$oFile") and move("$src$oFile","$dst$oFile") and &LogSentFiles($oFile) or warn "$oFile didn't move\n"; }
In reply to Re: a problem with arrays and undeffing i think
by graff
in thread a problem with arrays and undeffing i think
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |