You are much more likely to get the right answer to your problem if you post a COMPLETE working program that demonstrates your problem. In this case, it would be better to do only one of the three files. Even better, use a test file and attach a copy of that file. Print only to the screen. The code to print to a file is clearly not related to your problem. It only clutters your post.

I do not see anything wrong with the code fragment that you posted. (Except for unneeded parenthesis in the first three statements.) From this fragment, we cannot tell if you want the hash of the name or of the contents of the three files. (Your title suggests the later.) Did you correctly specify that they are binary files? Are you importing the module correctly? Are you certain that you are using your external program correctly? Good Luck, Bill

Here is my code for reading a usb hard drive, zipping it up, moving a scan of the hard drive label (PDF) into the directory and creating an MD5 file (which isn't producing the correct MD5 hash)

Code

#!/usr/bin/perl # # usbzip # # Copies all files on a drive $sourcedrive eg: E: to a zip file $target_zip # in a directory made from the $P00, A PDF file is then copied to this DIR # An MD5 and a list file are also created for the zip file # package usbzip; our $package = 'usbzip'; our $version = 0.7;

# If the target directory is there if (-e $destpath) { # If the target zip file is there if (-e $target_zip) { # Remove it unlink $target_zip or die "$package: Could not remove existing $target_zip, Error: $!\n"; print "\n**********Cleaning up files**********\n"; print "$package: Removed Existing ZIP file $target_zip\n"; } } else { # If the target directory is not there then make it print "\n**********Making directory**********\n"; mkdir $destpath or die "$package: Could not make $destpath, Error: $!\n"; print "$package: Made Directory $destpath\n"; }