b******e 发帖数: 432 | 1 What is the difference between the two following declarations?
my $thing1 = [ 1, 2, 3 ];
my @thing2 = ( 1, 2, 3 ); | S**I 发帖数: 15689 | 2 前一个是array,后一个是list
What is the difference between the two following declarations?
my $thing1 = [ 1, 2, 3 ];
my @thing2 = ( 1, 2, 3 );
【在 b******e 的大作中提到】 : What is the difference between the two following declarations? : my $thing1 = [ 1, 2, 3 ]; : my @thing2 = ( 1, 2, 3 );
| b******e 发帖数: 432 | 3 The first one: $thing1 = the reference to the array (1,2,3)
The second one: @thins2 is the array (1,2,3) |
|