在下面的代碼中,last
在while循環中做了什麼?我得知,如果$matrix[$i][$j]{pointer}
變量等於"none"
它調用last
但它有什麼作用?「last」在Perl中做什麼?
此外,爲什麼$ matrix變量包含使用大括號的分數和指針? {score}
,我把它作爲數組中的第三個維度讀取,但是這是其他的嗎?在google上找不到關於此的任何內容。謝謝!爲last
命令
my @matrix;
$matrix[0][0]{score} = 0;
$matrix[0][0]{pointer} = "none";
#populate $matrix with more stuff
while (1) {
last if $matrix[$i][$j]{pointer} eq "none"; #<-what is this "last" doing?
#do some more stuff here
}
這不是Python。我認爲這是Perl。 – GingerPlusPlus
爲什麼我的谷歌搜索無法正常工作。 – joshweir