fork download
  1. my $ref;
  2. {
  3. my @skipper = qw(blue_shirt hat jacket preserver sunscreen); # ref count is 1
  4. $ref = \@skipper; # ref count is 2
  5. print "$ref−>[2]\n"; # prints jacket\n
  6. }
  7. print "$ref−>[2]\n"; # still prints jacket\n # ref count is 1
Success #stdin #stdout 0s 3564KB
stdin
Standard input is empty
stdout
ARRAY(0x9b94890)−>[2]
ARRAY(0x9b94890)−>[2]