tish602 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am encountering this issue with my code and I pasted a portion of it and the result below. My problem is the $size_remote value for one particular file is not existing.
for ($a = 0; $a <=$count-1; $a++) { @size_local = $telnet->cmd("ls -ltr $src_cold/$list_files[$a] + \|awk '{print \$5}'"); chomp @size_local; $size_remote = $ftp->size($list_files[$a]); print "$list_files[$a] $size_remote $size_local[0] \n"; if ($size_local[0] != $size_remote) { Log::it $log, "Difference in size of $list_files[$a] $size +_remote in $host and $size_local[0] in $local.\n"; Log::it $eventfile, $msgstrng . "Difference in size of $li +st_files[$a] in $host and in $local.\n";
Here is a portion of the log file.
Net::FTP=GLOB(0x3c2780)<<< 226 Binary Transfer complete. Difference in size of initACPRD01.ora in ks214 and 3891 in 135.68.143 +.133. ********************* ACPRD01temp01.dbf.Z 401847211 401847211 ACPRD01temp_users01.dbf.Z 346455489 346455489 ACPRD01temp_users02.dbf.Z 401791822 401791822 ACPRD01tools01.dbf.Z 29597 29597 ACPRD01users01.dbf.Z 343452208 343452208 initACPRD01.ora 3891 lkACPRD01 24 24
You will notice that there's only 1 file size for initACPRD01.ora. Do you have an idea why this is happening?

Replies are listed 'Best First'.
Re: problem with the "size" method in FTP module
by hostyle (Scribe) on Nov 26, 2004 at 09:53 UTC

    Could be nothing but:

    Difference in size of initACPRD01.ora  in ks214 and 3891 in 135.68.143.133.

    There appears to be extra whitespace right after the filename. Is there a space in the filename? Are you allowing for this?

      Hi, I believe the extra white space was because I specifically indicated a space after the $list_files$a and after $size_remote which has no value.
      Log::it $log, "Difference in size of $list_files[$a] $size_remote in $ +host and $size_local[0] in $local.\n";