foreach $i (0 .. $#initList) { $command = < $log; user $rem_user $rem_passwd mput $ftp_source_path[$i] $ftp_dest_path[$i] bye eof eod }