See How (Not) To Ask A Question, but (completely off the wall guess here) perhaps you want to grep over the indexen rather than the array itself?
my @array = qw( foo bar baz quux ); my @idx_of_eles_with_an_a = grep $array[ $_ ] =~ /a/, 0..$#array;
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Grep reutrn the occurance of a pattern
by Fletch
in thread Grep reutrn the occurance of a pattern
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |