$LoL2D[$i][$j] can be written equivalently as$LoL2D[$i]->[$j] but |
NOT $LoL2D->[$i]->[$j] or $LoL2D->[$i][$j] |
as left hand side of -> MUST be a reference and NOT an array or hash |
$ref_to_LoL2D = \@LoL2D; # is allowed and now |
access by $ref_to_LoL2D->[$i][$j] or $ref_to_LoL2D->[$i]->[$j] |
Note [ .. ] or { .. } create anonymous arrays or hashs respectively which can be assigned to a reference and then dereferenced by -> |
( .. ) constructs a list which can be assigned to an Array or Hash |