in reply to printing array item reference names

A variable name has nothing to do with the values in it. You basically can't get the name of a variable from a value without some really advanced/unreliable trickery, and I've personally never had any use for this functionality.

If you want to print the names, you need to store the names in @masterarray.

my @masterarray = qw(@aaa @bbb @ccc); print $_ . "\n" for @masterarray;