my $element = $matrix[0]->[4]; # or by shorthand: my $element2 = $matrix[0][4];