my $until_no_upfile = "!ftp_file_exists ( '!!FTP_HOST!!', '$ftp::user', '$ftp::pass', '$ftp::dir', '$script::upfile_name' );"; my $then_upload; map { $then_upload .= "ftp_upload ( '!!FTP_HOST!!', '$ftp::user', '$ftp::pass', '$ftp::dir', '$_' ); " } ($script::order_file, $script::upfile_name); host_cycle($until_no_upfile, $then_upload);