in reply to Sort and Print Hashes simultaneously
You need only loop over one hash - you can easily test if that key is present in the second hash by accessing it as a hash. You can sort the keys in the loop declaration.
for my $key (sort { $a <=> $b } keys %websites) { if (exists $newsites{$key1}) { print "$key=$newsites{$key1}\n"; } }
Most of this is discussed in the Data: Hashes (Associative Arrays) section of perlfaq4.
|
|---|