The first thing I notice is that the code you posted will not even compile. You have a missing close brace:
sub ftpFileGet { my $workingDir = $globals[2]{'workingDir'}; my $select = Net::Netrc->lookup($host, $userAcct); my $pass = $select->password(); my $ftp = Net::FTP->new($host); $ftp->login($userAcct, $pass); $ftp->pasv; $ftp->binary; chdir($workingDir); foreach my $fileToGet (@matches) { $ftp->cwd("$remoteDir"); my $remoteFileSize = $ftp->size($fileToGet); my $localFileName = "$fileToGet"."$globals[1]{'transfer'}"; my $ftpReturnVar = $ftp->get($fileToGet, $localFileName); next if ! defined $ftpReturnVar; my $localFileSize = (stat "$workingDir/$localFileName")[7]; if ($remoteFileSize == $localFileSize) { push (@filesToRetrv, $ftpReturnVar); ## <<<<<<<<<<<<<<<<<<<<<<< Guess what is missing here!! } $ftp->quit(); return @filesToMove; }
In reply to Re: Memory leak!
by BrowserUk
in thread Memory leak!
by joeymac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |