in reply to printing out a matrix for a data list

Fix the output? Or the matrix filling code?

One problem I see in the output code is that you don't treat missing values. Probably you should iterate over all objects.

my %all = ( %rows, %cols ) my @objs = keys %all;
UPDATE: Another (or the?) problem I see is that you don't remove the newline in your data. chomp should fix this.