Is this an ok way to get all of the friends with brown hair and firstnames beg with the letter "j"?$n=0; for (@raw_list) { $n=$n+1; my @entry = split(/,/, $_); $sucker= { FIRSTNAME => $entry[0], LASTNAME => $entry[1], HAIRCOLOR => $entry[2], }; $friends{$n}=$sucker; } @results=grep ($$_{HAIRCOLOR}=~ /brown/i && $$_{FIRSTNAME}=~ /^j.*/i, + @friends{sort keys %friends});
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |