1 | Note my() can occur inside any block { } (not just at start of subroutine) and defines variables local to the block |
2 | The line |
3 | $LoL2D[$i] = \@list; |
4 | also creates a 2D array, but \@list is same location each time and so $LoL2D[$i][$j] gives the same answer (i.e., the final @list returned) regardless of the value of $i |
5 | In $Lol2D[$x][$y] one stores an array labelled by $x of hard references |
6 | Each hard reference is to an anonymous 1D array whose elements are accessed by $y |