in reply to Sort and Print Hashes simultaneously

First, $key1 = $key2 is an assignment, not a logical test (==) -- see perlop. This will return true provided the value in $key2 evaluates to true. warnings would have issued a warning if you'd tested your code before posting. See How do I post a question effectively?.

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.