$end = $#rocks; # 99, which is the last element's index
$number_of_rocks = $end + 1; # okay, but we'll see a better way later
$#rocks = 2; # Forget all rocks after 'lava'
$#rocks = 99; # add 97 undef elements (the forgotten rocks are
# gone forever)
$rocks[ $#rocks ] = 'hard rock'; # the last rock