
StarkRavingCalm
Novice
Jan 9, 2013, 10:34 AM
Views: 1220
|
|
Re: [FishMonger] Compare unchanged files in two arrays
|
|
|
Thanks, that works great! Need to play with the formatting a little if possible but that's not important. So... If I wanted to compare each of the two hashes, what it the best way to accomplish this: 'where value of keys are same write results to a list? array?' since I only want the filenames (keys), is an array the best way to represent this in perl? (I know you recommended MD5, but I want to try out each option and use each one as a learning opportunity) UPDATE: I found this code to compare the two: Just need to tie it together... for ( keys %hash1 ) { unless ( exists $hash2{$_} ) { print "$_: not found in second hash\n"; next; } if ( $hash1{$_} eq $hash2{$_} ) { print "$_: values are equal\n"; } else { print "$_: values are not equal\n"; } }
(This post was edited by StarkRavingCalm on Jan 9, 2013, 11:42 AM)
|