use PDL; $mat = pdl [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; print $mat->slice("1:2,1:2"); # 0 first index # print "[ # [5 6] # [8 9] # ]"