I have two data structures in Perl:
An array:
my @array2 = ( \"1\", \"2\", \"3\");
for $elem (@array2) {
print $elem.\"\\n\";
}
<
@array = ("1","2","3"); Here 1,2,3 is the element of @array variable. For ex. $array[0] is 1 , $array[1] is 2 and $array[2] is 3.
@array = ["1","2","3"];
Perl uses anonymous array references using [ ], so here basically only one element that you are storing, and that is the reference of an array ["1","2","3"] to the @array variable. for ex $array[0] is "ARRAY(0x9c90818)"
Hence while printing it is showing you the references.