#ref_use.pl
@array = (21..30);
$array_ref = [1,"two","three","stayhigh","five"];
print $array_ref."\n";#reference所參照的記憶體位置:ARRAY(0x10463af0)
print @$array_ref."\n";#reference的長度:5
@get_array_from_ref = @$array_ref;
# 將所參照的陣列給@get_array_from_ref=(1,"two","three","stayhigh","five")
print "@get_array_from_ref","\n";
$var = @$array_ref;
print "$var => $var";
沒有留言:
張貼留言