use Math::Matrix; use Data::Dumper; my $two_d = [ [1,2,3], [4,5,6], [7,8,9], ]; my $m = Math::Matrix->new($two_d); print Dumper $m;