亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: 懇請(qǐng)大神來(lái)解釋一下! [打印本頁(yè)]

作者: yxmingliang    時(shí)間: 2014-12-05 16:05
標(biāo)題: 懇請(qǐng)大神來(lái)解釋一下!
這是程序
當(dāng)子程序中的print禁止的時(shí)候,結(jié)果如圖
當(dāng)子程序中的Print輸出的時(shí)候,結(jié)果如圖
請(qǐng)問(wèn)$result結(jié)果為什么會(huì)有不同?
作者: 只是一個(gè)紅薯    時(shí)間: 2014-12-05 18:17
lz你要明白函數(shù)的返回值是什么,如果函數(shù)里面沒(méi)有return,是返回最后一行作為返回值
注釋掉print時(shí),return $i=120,
沒(méi)注釋print時(shí),reurn (print xxxx),是scalar,值為1

The return value of the subroutine (or of any other block, for that matter) is the
value of the last expression evaluated. Or, you may use an explicit return state-
ment to specify the return value and exit the subroutine from any point in the
subroutine. Either way, as the subroutine is called in a scalar or list context, so
also is the final expression of the routine evaluated in that same scalar or list
context


回復(fù) 1# yxmingliang


   
作者: b114213903    時(shí)間: 2014-12-05 20:27
回復(fù) 2# 只是一個(gè)紅薯


    此樓正解!!
作者: yxmingliang    時(shí)間: 2014-12-05 21:18
請(qǐng)問(wèn)返回值為什么是1呢?是表示true么?回復(fù) 2# 只是一個(gè)紅薯


   




歡迎光臨 Chinaunix (http://72891.cn/) Powered by Discuz! X3.2