in reply to ftp issue in perl

Unrelated suggestion ... You use the following construction several times:
$ftp->cwd($directory) or $newerr=1; push @ERRORS, "Can't cd $!\n" if $newerr; myerr() if $newerr; $ftp->quit if $newerr;
This does not clearly show you're trying to do, and distracts the viewer. An alternative might be:
if ( !$ftp->cwd($directory) ) { push @ERRORS, "Can't cd $!\n"; myerr(); $ftp->quit; }
Or, similarly
$ftp->cwd($directory) or ReportError( "Can't cd" );
where ReportError is a sub that takes the error-string as an argument, and does the push, the myerr, and the quit.