http://www.perlmonks.org?node_id=932204

rnaeye has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to learn about Perl complex data structures. I was wondering if anyone could tell me how to deference and print @my_array_reference2. Thank you.

#This one prints: my @my_array_reference1 = ( [qw(blue green red yellow)] ); foreach (@my_array_reference1){ print "@$_"; }; ############################################## #How can I dereference and print this one: my @my_array_reference2 = ( 'BLACK', [qw(blue green red yellow)] );