Either answer or go away.
Excuse me, but this guy went out of his way to give you a few pointers and you just insulted him. Any help is better than no help at all. Further, you probably haven't really looked at grep. If you had, the solution would quickly become obvious.
Nobody here is going to hand you the code--you have to do it for yourself or you'll never learn. I will, however, hand you part of the code.
@results=grep {SOMETHING} @friends{sort keys %friends};
All you have to do is figure out what goes in place of the SOMETHING. It's not that difficult.
=cut
--Brent Dax
There is no sig.