in reply to hash compare

You did not specify what to do if the file is missing in one of the hashes. The following code informs you about all the possible situations:
#!/usr/bin/perl use warnings; use strict; use feature qw(say); my %size1 = ( 'autorun.inf' => 42, 'autoexec.bat' => 118, 'eicar.zip' => 186, ); my %size2 = ( 'autorun.inf' => 42, 'autoexec.bat' => 119, 'ibmbio.com' => 234186, ); my %files; undef @files{keys %size1, keys %size2}; for my $file (keys %files) { delete $files{$file}, next if exists $size1{$file} and exists $size2{$file} and $size1{$file} == $size2{$file}; $files{$file} = 'Missing in 1', next unless exists $size1{$file}; $files{$file} = 'Missing in 2', next unless exists $size2{$file}; $files{$file} = 'Size changed'; } for my $file (keys %files) { say "$file\t$files{$file}"; }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ