Hey, thanks that worked! --- James Edward Gray II <[EMAIL PROTECTED]> wrote: <snip> > I don't seen any reason to use the array at all, so > I've removed it. > If you had one that I just didn't know about, send > it on back.
That's how I tried to solve this piecewise, I thought an array was necessary, or at least, it seemed logical to me. (another example of TMTOWTDI) I don't understand this syntax: $linehash{$1}++; I understand that $linehash{$1} refers to a single key within a key value pair of the hash, and I think the ++ is for incrementing each player's line, but I don't understand how it works. Could you explain it to me? Thanks a bunch for the help! -stu > > > #!/usr/bin/perl > > > > use warnings; > > use strict; > > > > open(STATS, "stats.txt") or die "statfile\n"; > > my %linehash; # removed extraneous vars > > while (<STATS>) > > { > > if (/(\w+\b) (Jump Shot)/) # matches default to > $_, so you don't have > > to write it > > { > > $linehash{$1}++; > > } > > } > > while (my($key,$value) = each(%linehash)) # print > when we're all done > > { > > print "$key:$value\n"; > > } > > Hope that helps. > > James > > > -- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __________________________________ 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]