in reply to simple matrix

And you would be well advised to spend some time becoming acquainted with the "Perl Data Structures Cookbook", found in your documentation as "perldsc".

You might also be well advised to consider using an HoH - a Hash of Hashes which means you do not need to fill every position in the matrix. Whilst in other languages you might find a matrix the easiest way of dealing with such a dataset it has been my experience that in Perl it is rarely the best way. Matrices are best kept for dealing with data which can be represented no other way.

I would also re-iterate the advice already given that you should always use strict and warnings, you would have found the error long before opening your browser to come here.

jdtoronto