NAME Cache::File - Filesystem based implementation of the Cache interface SYNOPSIS use Cache::File; my $cache = Cache::File->new( cache_root => '/tmp/mycache', default_expires => '600 sec' ); See Cache for the usage synopsis. DESCRIPTION The Cache::File class implements the Cache interface. This cache stores data in the filesystem so that it can be shared between processes and persists between pro
名前¶ File::Transaction - ファイルの集合へのトランザクション的な変更 概要¶ # # この例では、私は複数のファイルにある'foo'という単語を'bar'で # 置き換えようとしています。そしていくつかのファイルで置換が # おこなわれ、他のものでは行われないまま終わらせてしまう # 危険性を最小限にしたいと思っています。 # use File::Transaction; my $ft = File::Transaction->new; eval { foreach my $file (@list_of_file_names) { $ft->linewise_rewrite($file, sub { s#\bfoo\b#bar#g; }); } }; if ($@) { $ft->revert; die "update aborted: $@"; } else { $
NAME Cache::FileCache -- implements the Cache interface. DESCRIPTION The FileCache class implements the Cache interface. This cache stores data in the filesystem so that it can be shared between processes. SYNOPSIS use Cache::FileCache; my $cache = new Cache::FileCache( { 'namespace' => 'MyNamespace', 'default_expires_in' => 600 } ); See Cache::Cache for the usage synopsis. METHODS See Cache::Cach
はじめに tokuhirom’s cgi-extlib-perl at master – GitHub このあたりを見て,ポータブルな(サーバに置くだけで動作する?)モジュールについて,ちょこっとだけ勉強を始めました. この先何回か,ここにあるモジュールを触ってみたメモなんかをエントリしてみようと思います. 今回は,Cache::FileCacheモジュールについてです.恥ずかしながら,これまでデータとかのキャッシュ処理を扱ったことがほとんどなかったので,そのあたりの勉強もかねて. Cache::FileCache – search.cpan.org Cache::Cache – search.cpan.org では以下. 基本 use Cache::FileCache; my $cache = Cache::FileCache->new({ namespace => 'filecache
ベンチマークする時の留意点をあげてみます。ちょと長いけど興味ある人は読んでね。 ファイルを読み込んで操作するコードについて、Perl Best Practiceでは my $code = do { local $/; <$in>} とすることで、ファイルを一気読みすることを薦めている。 これに対して下記は、バッドなやり方として書かれているものです。 my $code; while(my $line = <$in>) $code .= $line; } スカラー文を連結するドット演算子の . (concat)を使っているので、スピードが落ちてしまうからだという。 さて試しに二つのコードをベンチマークしてみます。 #!/usr/bin/perl use strict; use Benchmark qw(cmpthese); cmpthese( 1000 , { 'slurp' => \&rea
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く