http://www.perlmonks.org?node_id=689273


in reply to Re: structuring data: aka walk first, grok later
in thread structuring data: aka walk first, grok later

I'd probably just make the coordinates into an array (and maybe define constants):
use constant { X => 0, Y => 1, }; my %DATA; while (<>) { my ($obs, $det, $x, $y) = split ' '; push(@{$DATA{$obs}{$det}}, [ $x, $y ]); } print "$DATA{21}{'DET-2'}[0][X]\n";