#/usr/bin/perl -w use strict; #much other stuff.... #initializations etc.... foreach $file (@list_of_filenames){ open(THISFILE,'< $file') or warn "ERROR: Can't open $file!\n";#for this application fail to open is not fatal.. binmode(THISFILE); $data = Digest::MD5->new->addfile(*THISFILE)->hexdigest; return unless ($data); #...process $data..... }