in reply to Array of Hashes
my @elements = grep { exists $_->{$captureId} } @outputFiles;
If you really want the index of the element, rather than the element itself, you can change the grep to:
my @indexes = grep { exists $outputFiles[$_]{$captureId} } 0..$#outputFiles;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array of Hashes
by ramya2005 (Scribe) on Sep 20, 2005 at 17:42 UTC | |
by friedo (Prior) on Sep 20, 2005 at 17:48 UTC |