[lang_zh]
前幾天在寫 Sabermetrics.pm (一個用來計算棒球一些統計數據的 pm, 弄完整一點再 release) 時,遇到了某個問題 (這個之後再說)。於是在 perldoc -f ref 裡面看到 ref 會傳回 'LVALUE',但其餘什麼都沒說啊 O_O
於是找到了這個範例程式:
http://www.farid-hajji.net/books/de/Hajji_Farid/pbv2/pw/ref-lvalue.pl.html
滿噁心的。不過看起來像是只用能在 built-in function 上,我試不出怎麼讓自己定義的 function 也能這樣用 :(
[/lang_zh]
[lang_en]
While I'm working on Sabermetrics.pm (which is for basebal statistics. It'll be released soon) these days, I encountered some problem and refered to 'perldoc -f ref'. It mentions about returning LVALUE' without any other information.
And I just find this sample program:
http://www.farid-hajji.net/books/de/Hajji_Farid/pbv2/pw/ref-lvalue.pl.html
Quite ugly. It seems to work on built-in function. I can't figure out how to use it with my own function :(
[/lang_en]
沒有留言:
張貼留言