Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my %hash = map {$numbers[$_] => $values[$_]} 0 .. $#numbers; # my @keys = keys %hash; # print @keys; foreach my $thing (@array) { # print $thing; if (exists ($hash{$thing})) { push @new_array, $thing; } } print @new_array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hashes - finding values
by broquaint (Abbot) on Jul 03, 2003 at 13:33 UTC | |
by Anonymous Monk on Jul 03, 2003 at 13:45 UTC | |
by broquaint (Abbot) on Jul 03, 2003 at 13:50 UTC | |
|
Re: hashes - finding values
by Zaxo (Archbishop) on Jul 03, 2003 at 13:43 UTC | |
by Anonymous Monk on Jul 03, 2003 at 13:59 UTC | |
by Zaxo (Archbishop) on Jul 03, 2003 at 14:29 UTC | |
by BrowserUk (Patriarch) on Jul 03, 2003 at 14:35 UTC | |
|
Re: hashes - finding values
by davorg (Chancellor) on Jul 03, 2003 at 14:11 UTC | |
|
Re: hashes - finding values
by pfaut (Priest) on Jul 03, 2003 at 13:34 UTC | |
|
Re: hashes - finding values
by hardburn (Abbot) on Jul 03, 2003 at 14:15 UTC |