in reply to Counting the Times Two Unknown Values Appear Together
I think maybe you want this:
while (<FILE>){ my ($src,$sport) = (split /;/)[9,12]; $hash{$src}{$sport}++; }
Then you can say something like...
foreach my $src ( keys %hash ) { foreach my $sport ( keys %{$hash{$src}} ) { printf "%s appears with %s %d times\n", $src, $sport, $hash{$src}{$sport}; } }
Or just use something like Data::Dumper or YAML to spew out the whole structure.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Counting the Times Two Unknown Values Appear Together
by jdporter (Paladin) on Jul 16, 2007 at 02:36 UTC | |
|
Re^2: Counting the Times Two Unknown Values Appear Together
by Dru (Hermit) on Jul 16, 2007 at 13:53 UTC |