我剛剛開始使用Perl腳本,同時製作數組並從哈希變量中獲取數組。我得到一個尷尬的輸出。哈希變量和Perl中的數組給出了一個尷尬的輸出
代碼是在這裏:
%name= ("xyz",1 ,"is",2, "my",3,"name",4);
%copy=%name;
$size=%name;
print " your rank is : $copy{'xyz'}";
print " \n";
print " the size of the array is : $size";
輸出即將爲:
your rank is : 1
the size of the array is : 3/8
爲什麼數組的大小爲3/8?
有一個在你的代碼沒有數組。你認爲哪個變量是一個數組? –