perlquestion
sickboy
hey,</br>
say i had friends. A thousand of those little suckers.</br>
<code>
for (@raw_list) {
my @entry = split(/,/, $_);
$sucker= {
FIRSTNAME => $entry[0],
LASTNAME => $entry[1],
HAIRCOLOR => $entry[3],
};
$friends{$n}=$sucker;
}
</code>
i want to be able to query this %friends for say</br>
all the people that have brown hair and a first name starting with the letter j*. </br>
I have come up with ways to do this, but i dont want to have to :</br>
<code>
foreach $n (sort keys %friends) {
$sucker=$friends{$n};
if ($sucker->{FIRSTNAME}=~/^j.*/) {$d++;}
ect...
</code>
Please refrain from the "i won't give you the code because.."</br>