#!/usr/bin/perl -w use strict; # array : assume address 123 my @a = qw(one two three); # reference to array in address 123 # (ARRAY(0x123) my $aa = \@a; # referencec to anonymous array containing # one element, the reference to array @a, # (ARRAY(0x123)) # assume $bb = ARRAY(0x789) my $bb = [$aa]; # @{$aa} returns the array at address 123 # - which is just array @a, # the \@{$aa} returns a reference to the # array at address 123. # - so $cc = ARRAY(0x123) my $cc = \@{$aa}; # results print "array a <@a>\n"; print "reference to array a <$aa>\n"; print "reference to anon array containing reference to array <$bb>\n"; print "contents of array referred to by \$bb <@$bb>\n"; print "reference to the array referred to by \$aa <$cc>\n"; print "contents of array referred to by \$cc, or array a <@$cc>\n";