in reply to Getting element of array with a match

Actually a simple loop might be cleaner and clearer in this instance:
my $thing; foreach (@array) { if (/^1006,(.*)/) { $thing=$1; last; } }
or even:
my $thing; foreach (@array) { my ($num,$value) = split /,/; if ($num == 1006) { $thing=$value; last; } }
BTW, your code above won't work because grep returns the number of matches in scalar context.

-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."