So I'm following the book Learning Perl, there's this code with comments in it:
$rocks = 'bedrock';
$rocks = 'slate';
$rocks = 'crushed rock';
$rocks = 'schist';
$#rocks = 2; # forget all rocks after 'lava'
$#rocks = 99; # add 97 undef elements (the forgotten rocks are gone fo
If I do print $rocks[$#rocks];
it prints nothing. Why? When I comment out $#rocks = 99;
it prints 'lava' and when I comment out $#rocks = 2;
it prints 'schist'. But when I maintain the two it prints nothing as I already said. And what the comments "add 97 undef elements (the forgotten rocks are gone forever)" and "forget all rocks after 'lava'" mean?