http://qs321.pair.com?node_id=745912


in reply to (Mis)Understanding grep...eq $_

I thought I understood grep $person_has eq $_, $item {...} to mean:

That's not valid Perl.

search $person_has for

grep $person_has eq $_, $item searches through the list after the comma ($item), not through $person_has. The first expression tells us what is being sought: elements equal to $person_has.