Actually, perl has a built-in facility for this... if you simply say:
$hash{$coord1,$coord2} = $value;
then perl automatically constructs a hash key as:
$key = join($;, ($coord1, $coord2));
using $;, the "subscript separator" perl variable. The default value of which is octal 034, the control character "field separator". This isn't quite a perfect solution if your variables can store arbitrary binary data... but, in general, you're pretty safe against occurences of this character occuring in your data. You can perldoc perlvar for more details.
------------
:Wq
Not an editor command: Wq