Perl入学式 全6回のPerl入門講座。東京、大阪、沖縄、札幌で開催。(東京は4月と10月スタート、それ以外は5月スタート) YAPC::Japan Perlを軸としたITに関わる全ての人のためのカンファレンス。 東京 吉祥寺.pm 五反田.pm 大阪 なにわPerl 沖縄 沖縄.pm
メソッドチェーンを使うとデバッグしづらくなるんでないか、という疑問に対するMojo的な反論。 my $instances = Mojo::Loader->new->load('Book')->build;という文があるとき、loadに失敗したらどうなるかを考えてみる。 よくあるメソッドのようにload('Book')がクラスないしオブジェクトを返す場合は、ロードにこけたら次のbuildを実行するオブジェクトがないといって怒られるのがふつうだ(or die $@などで判定しやすくなるよう、undef、あるいはその他の偽になる文字列などが返ってくることが多いため)。だから、evalでくるんだり、チェーンを切って逐一エラーチェックする必要がある。 Mojoのように基本的には自分を返し続けるチェーンなら、そうはならない。実際にMojo::Loaderのloadとbuildのソースを見てみよう。 s
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く