in reply to Re: 3d arrays
in thread 3d arrays

So the input is unordered, each line indicates one bean at the location given, and you just want to tally them up and then print them out in grid order? Sounds like:
my %beancounts; while (<>) { my ($x, $y) = split; ++$beancounts{$x}{$y}; } for my $x (sort {$a <=> $b} keys %beancounts) { for my $y (sort {$a <=> $b} keys %{$beancounts{$x}}) { print "$x $y $beancounts{$x}{$y}\n"; } }

Caution: Contents may have been coded under pressure.