思いは言葉に。 はてなブログは、あなたの思いや考えを残したり、 さまざまな人が綴った多様な価値観に触れたりできる場所です。
思いは言葉に。 はてなブログは、あなたの思いや考えを残したり、 さまざまな人が綴った多様な価値観に触れたりできる場所です。
Data::Validator - Rule based validator on type constraint system use 5.10.0; use Data::Validator; # for functions sub get { state $rule = Data::Validator->new( uri => { isa => 'Str', xor => [qw(schema host path_query)] }, schema => { isa => 'Str', default => 'http' }, host => { isa => 'Str' }, path_query => { isa => 'Str', default => '/' }, method => { isa => 'Str', default => 'GET' }, ); my $args
昨日でたNet::DNS::Lite-0.09の変更点に関する話。 Furlと組み合わせて使うと幸せになれる Net::DNS::Lite のtimeoutとretry回りは若干変わった実装になっていて、 use Net::DNS::Lite; my $r = Net::DNS::Lite->new( server => [qw/8.8.8.8 8.8.4.4/] ); $r->resolve("google.com", "a"); このように実行すると、 #サーバ一覧 [server,timeout] my @retry = ( ['8.8.8.8',2], ['8.8.4.4',2], ['8.8.8.8',5], ['8.8.4.4',5], ['8.8.8.8',5], ['8.8.4.4',5] ); 2秒=>5秒=>5秒とタイムアウト時間が変化しつつ、上の順番でサーバ一覧が作ら
Data::Model::Driver::Memcachedで超効率データ保存 - JPerl Advent Calendar 2009 Perl に関するちょっとした Tips をのっけてみるよ。ちゃんと続くかな? はじめに YAPC::Asia 2009で、Data::Modelの話を聞いて以来、Data::Modelがとても気になっているdannです。 今回は、Data::Model::Driver::Memcachedについて紹介します。これは、Memcachedプロトコルを話すサーバーにデータを格納するためのDriverです。これの素晴らしいところは、空間効率を高めることを考えて設計されていて、かつアプリケーション側のコードは綺麗にかける工夫がなされているという点です。 では、どこにその工夫があるかをみていきましょう。 Data::Model::Driver::Memcached
I like Path::Class, but it’s clunky and slow. So I wrote Path::Tiny to scratch my itch. It’s smaller (roughly half the lines of code), comes in a single file, and is generally faster. Among other things, it has lots of handy UTF-8 input and output methods. The downside is that it’s less portable and less extensible, but let’s be honest, most of us are developing only for Unix or Windows anyway. An
日付の取り扱い 何かと面倒な日付処理には DateTime.pmをつかいます。 生成 use strict; use warnings; use DateTime; #日付を指定して生成 $dt = DateTime->new( time_zone => 'Asia/Tokyo', year => 2008, month => 8, day => 4, hour => 15, minute => 0, second => 0 ); #epochから生成 $dt = DateTime->from_epoch( time_zone => 'Asia/Tokyo', epoch => 1217829600 ); #現在の日付(時間ふくむ) $dt = DateTime->now( time_zone => 'Asia/Tokyo' ); #現在の日付(時間含まない) $dt = DateTime
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く