in reply to Getting indices of the same value that occurs multiple times in an array...
my @indexes = grep { $a[$_] eq $search_for } 0..$#a; $participants{$og} = \@indexes;
This puts an array reference of all found indexes into the hash. See perlreftut for more information about references, and why you need them here.
|
|---|