in reply to Suggestions on how to make array of hashes with this...

Do the numbers in the first column matter? They appear to be line numbers in the data file. Using them as array indexes will leave only the 4n+1 ones defined.

Assuming they don't matter, I notice that they are grouped so that the number divided by 4 is the same within a group. Therefore:

my @aryhash; while (<HANDLE>) { chomp; my @dat = split " ", $_; # magical whitespace split $aryhash[$dat[0]/4|0]->{$dat[2]} = $dat[3]; }
This is a pretty direct way to do it, but is tightly bound to your data format.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Suggestions on how to make array of hashes with this...
by snafu (Chaplain) on Sep 21, 2001 at 09:43 UTC
    The numbers in the first column are not actually a part of the dataset. I used those numbers strictly for example only but they can most definitely be used for array indices. This reply most intrigues me since the dataset should always be the same and you are using a mathematical means to resolve the issue. I might try this one out for fun to see how it works. Using math to solve problems like this has always intrigued me.

    ----------
    - Jim