grep returns the elements for which the test is true, so in your case you'd get the matching arrayrefs
of course you have no arrayrefs in @test2 with ER as their first element
perhaps you meant $_->[0] =~ /ER/ as the test?
Then again that'd just give you two items ([ "XERXES", "1002"] and [ "SHERRY", "1006" ]) in @grepnames
so you'd probably want to iterate over the indexen of your array instead if that's what you're really interested in (i.emy @name_indexen = grep $test2[ $_ ]->[0] =~ /ER/, 0..$#test2;)
Of course if you're really interested in the names themselves then what you really want is probably going to wind up some combination with map and you'll want to search for the term "schwartzian transform"
The cake is a lie.
The cake is a lie.
The cake is a lie.
Comment on Re: substring search in an array of arrays