Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my @array; # contains various numbers my %hash = map {$numbers[$_] => $temps[$_]} 0 .. $#numbers; while (($key, $value) = each (%hash)) { if ($key == $array[$_]) { push @found, $key . $value; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hashes: testing for the presence of a key
by Ovid (Cardinal) on May 15, 2003 at 14:01 UTC | |
|
Re: hashes: testing for the presence of a key
by broquaint (Abbot) on May 15, 2003 at 14:00 UTC | |
|
Re: hashes: testing for the presence of a key
by jdporter (Paladin) on May 15, 2003 at 14:11 UTC | |
by BrowserUk (Patriarch) on May 15, 2003 at 14:20 UTC |