Doing linear scans over an associative array is like trying to club someone to death with a loaded Uzi. -- TimToady
for my $key (sort { $a <=> $b } keys %websites) { if (exists $newsites{$key}) { print "$key=$newsites{$key}\n"; } }
See also: sort, keys, exists, perlfaq4.
In reply to Re: Sort and Print Hashes simultaneously
by moritz
in thread Sort and Print Hashes simultaneously
by sundeep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |