This may be a silly question... The following code outputs the contents of @arrayref
and @arraycont
respectively. Note the difference between them
The first block stores the address of @array. REferences are like 'live streaming', you get current status. So if you create a reference to @array, like \@array, when you de-reference it you will always get what @array points at the moment of de-reference. When you de-refer @array was having (5 6 7 8)
When you do [@array] its like recording the live streaming into your disk. So when you (re)play the recorded content you get what was
streamed at the time of recording. So when you refer $arraycont[0] you get what @array was having at the time of copying that is
(1 2 3 4)