There is also a more compact form of this query: print $M->(1,2); It has the same performance as the expression above, but saves some typing and also works as lvalue , that is, if the matrix $M is not write-protected, you can assign to it any boolean expression: $M->(1,2) = 0; $M->(2,1) = $a &&a...