my %md5_of_known_bad; foreach $md5data (@knownbad) { ... $md5_known_bad{$filename} = $md5hash; }