use PDL;
$a = pdl [
[ 3, 2, 3 ],
[ 5, 9, 8 ],
];
$b = pdl [
[ 4, 7 ],
[ 9, 3 ],
[ 8, 1 ],
];
$c = $a x $b; # x overload
If you don't have the PDL library, or don't feel like pulling it in
for a small problem, you can always do the work yourself the good
old-fashioned way.
# mmult( ) and other subroutines as shown earlier
$x = [
[ 3, 2, 3 ],
[ 5, 9, 8 ],
];
$y = [
[ 4, 7 ],
[ 9, 3 ],
[ 8, 1 ],
];
$z = mmult($x, $y);