First you have to decide/determine what the primary index is. For example, it might be the two character first column or it may be a combination of several columns. You don't give enough information to be sure. (Though your sample data structure indicates that you're using a single key.)
Lets suppose that the first and second column comprise your key--In that case, you could do something like:
my %data; while (my $line=<$INPUT_FILE_HANDLE>) { my ($rectype, $testID, $dimX, $dimY, $polynomial) = parse_input_line($line); my $key = "$rectype:$testID"; $data{$key} = { RecType => $rectype, TestID => $testID, DIM => [ $dimX, $dimY ], Polynomial => $polynomial, }; }
Note the square brackets on the DIM line: that's how you can place an array reference inside your hash.
Does this answer your question? I don't feel like I understand just what it is you're having difficulty with, so I just guessed. If you could provide a bit more detail, we can give better answers.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: Multidimentional hash
by roboticus
in thread Multidimentional hash
by freekngeek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |