#!/usr/bin/perl -w use strict; my @friends; my @raw_list = ; chomp @raw_list; for (@raw_list) { my @bits = split(/,/, $_); my $sucker= {FIRSTNAME => $bits[0], LASTNAME => $bits[1], HAIRCOLOR => $bits[2]}; push @friends, $sucker; } # demo a boolean test if ($friends[1]{HAIRCOLOR} =~ /blond/) { print "Jane's hair is blond\n"; } # rough in the crucial bit... my $count = grep {#firstname#test# and #haircolor#test# } @friends; print "Count: $count\n"; __DATA__ John,Brown,red Jane,Brown,blond Jodi,Brown,brown Bill,Black,blond June,Green,brown Erin,White,brown