[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Dimensional question



Hi
I know this is not a macperl specific question but maybe someone
can help me. I want to make a multidimensional frequencies
table from a set of data

one way is to put all thing into an multidim hashtable and
then print it out. The problem is the number the dimension are unknown
how I change the number of dimmension?

Maybe someone can recommend a book about this problem

here is small exampel for 3 dimension, column 0,1 and 3 from
the rawdata

#!perl -w

use Data::Dumper;
while (<DATA>){
  @tmp=split;
  $s{$tmp[0]}{$tmp[1]}{$tmp[3]}++;
}
print Dumper([%s]);
__DATA__
a 2 1 7 7 4
b 1 1 5 6 5
a 5 1 7 5 6
c 2 1 5 4 7
a 4 1 3 5 8
a 4 1 6 6 3
b 4 1 6 7 4
c 1 1 4 4 5
c 1 1 4 4 5
a 1 1 1 1 1

_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Claes Bjorklund
claes@canit.se
http://www.canit.se/~claes
===========================



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org