my @aryhash; while () { chomp; my @dat = split " ", $_; # magical whitespace split $aryhash[$dat[0]/4|0]->{$dat[2]} = $dat[3]; }