Perl, array referencing

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-05-27T18:29:03Z Indexed on 2010/05/27 18:31 UTC
Read the original article Hit count: 371

Filed under:
|
|

Consider this Perl code

my @a=[[1]];

print $a[0][0] . "\n";


**output**
ARRAY(0x229e8)

Why does it print an Array instead of 1? I would have expected @a to create an array of size 1 with a reference to a second array containing only one element, 1

© Stack Overflow or respective owner

Related posts about perl

Related posts about array