2006-06-12から1日間の記事一覧
ところで、前のエントリのperlsubで、気になる一文を見つけたのです。 Note, however, that the ``&'' is NOT optional when you're just naming the subroutine, such as when it's used as an argument to defined() or undef(). え、definedとundefって、…
perlも忘れてないですよ(´m`)。次のコードの結果に、納得できますか? sub my_print{ print @_; } sub test1{ my_print;} sub test2{ &my_print;} test1("test1\n"); test2("test2\n"); 【結果】 test2納得出来たらかなりの通。perlsubには以下のように書い…