in reply to using hash values inside an array.

This is well explained in perlref and perldsc, which talk about manipulating nested data structures. If you read through them, you will find them very useful, and full of examples.

As a short example of how to loop over a hash of lists, here is a crude way to print out your data structure:

for my $key (keys %coords) { print "$key =>\n"; for my $x_coord (@{$coords{$key}}) { print " $x_coord\n"; } }