I have a hash called fouls.  Within that hash, there
are other hashes called offensive, personal, and
shooting.  The keys to those hashes are names, like
Smith, Rodriguez, and Chan.  and the values to those
names are numbers.
I think if I wanted to access the number of offensive
fouls Chan committed, the syntax would be this:

$fouls{$offensive}{$Chan};

Is that right?

Assuming it is, and I have a file that is collecting
the lines that indicate fouls, then of those,
separating the ones that indicate offensive, personal
and shooting, and then of those the ones that indicate
Smith, Chan and Rodriguez and then increment each
instance.  If my backreference variable $3 was storing
on each pass in the while loop the type of foul
(offensive, personal or shooting) and $1 was storing
the name (Chan, Rodrigues or Smith)  how would I print
the %fouls hash out so that the output would be
grouped by type of foul?  Here is an example of the
output I'd like to see?

Offensive fouls:
Chan: 3
Rodriguez: 1
Smith: 1

Personal fouls:
Chan: 1
Rodriguez: 4
Smith: 1

Shooting fouls:
Chan: 1
Rodriguez: 1
Smith: 2

would I nest foreach loops?  If so, I'm still not sure
how I'd do that.  Thanks in advance. -stu

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to