if ( &download( $url, $save_file ) ) { # Successfully downloaded, now compair previous md5 value # and if different move to the transfer folder my ( $guidId, $ext ) = split ( '.zip', $guid ); my $md5File = "${hifld_md5_folder}/${guidId}.md5"; open ( MD5, '+>>', $md5File ) || &loggingError("Couldn't open md5 file ($md5File) for reading : $!"); $md5row = ; close( MD5 ); my $md5chksum = &calcMD5( $save_file ); print "md5row = ${md5row}\n"; print "md5chksum = ${md5chksum}\n\n"; # check to see if the file has changed since the last download # if not then delete the downloaded file otherwise # update the md5 file and rename the downloaded file for moving if ( $md5row = $md5chksum ) { my $cmd = "rm $save_file"; # `$cmd`; } else { # Update the md5 file open ( MD5OUT, '>', $md5File ) || &loggingError("Couldn't open md5 file ($md5File) for writing : $!"); print MD5OUT "${md5chksum}"; close( MD5OUT );