I used the following code to check the hash keys in 2 hashes and print the same occurring hash key and its respective value
while (((my $key1,my $value1)=each(%websites))) { while (((my $key2,my $value2)=each(%newsites))) { if($key1 = $key2) { print "$key2=$value2 \n"; } } }
But, i want to sort the hash keys numerically in both the hash tables and then print the common key and the value . So how can i sort and print it simultaneously
In reply to Sort and Print Hashes simultaneously by sundeep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |