in reply to Representing Complex but Static Data in Perl

There is a Readonly module. This is not the same const, as a Readonly::Hash is slower than a normal Hash.

You might consider making your data an object. Then it's use will be clearer, and you can control access if you need to.

package ChessMoves; sub new { my $class = shift; return bless {0 => { 0 => [ [[1, 0],[2, 0],[3, 0],[4, 0],[5, 0],[6, 0], [7, 0]], [[0, 1],[0, 2],[0, 3],[0, 4],[0, 5],[0, 6],[0, 7]], ] }} $class; } sub get_moves { my $self = shift; my ($row, $col) = @_; return $self->{$row}{$col}; }
-- gam3
A picture is worth a thousand words, but takes 200K.