1

Topic: Perl: it is better to store number of an array cell or a element?

There is an array of hashes:
@rows = [{' id ' => 1, ' name ' => ' abc '...}, {' id ' => 2, ' name ' => ' def '...}...]
For fast search in this an array I do an index:
$idx = {' abc ' => $rows [0], ' def ' => $rows [1]...}
Or it is better to do it such?
$idx = {' abc ' => 0, ' def ' => 1...}