2009-04-01から1日間の記事一覧

B::Foreach::Iteratorでforeachイテレータを進める

B::Foreach::Iteratorというモジュールを書いた*1。 use B::Foreach::Iterator 0.02; foreach my $key(foo => 10, bar => 20, baz => 30){ printf "%s => %s\n", $key => iter->next; } iter->next()*2はforeachループのイテレータをひとつ進め、その値を返…