in reply to Sort and Print Hashes simultaneously
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sort and Print Hashes simultaneously
by sundeep (Acolyte) on Nov 01, 2010 at 16:49 UTC |