my $ref;
{
my @skipper = qw(blue_shirt hat jacket preserver sunscreen);
$ref = \@skipper;
print "$ref->[2]\n"; # prints jacket\n
}
print "$ref->[2]\n"; # still prints jacket\n
Immediately after the @skipper array is declared,
you have one reference to the five-element list. After
$ref is initialized, you'll have
two, down to the end of the block. When the block ends, the
@skipper name disappears. However, this was only
one of the two ways to access the data! Thus, the five-element list
is not removed from memory, and $ref is still
pointing to that data.