2008-11-03から1日間の記事一覧

今日出会ったCPANモジュール

File::HomeDir - Find your home and other directories, on any platform use File::HomeDir; $home = File::HomeDir->my_home; $desktop = File::HomeDir->my_desktop; $docs = File::HomeDir->my_documents; $music = File::HomeDir->my_music; $pics = F…

Plagger:YAMLの色々な書き方

Bloglinesの更新フィードをGmailへ送信する。以下は,得に有用な書き方という訳ではなく,Plaggerではこんな書き方もできるんだねという豆知識程度に捉えて下さい。 # base.yaml global: plugin_path: - /path/to/Plugin assets_path: /path/to/assets timez…

caller関数のメモ

#!/usr/bin/perl use strict; use warnings; package Foo; use Perl6::Say; sub foo { my ($pkg, $file, $line); $pkg = caller; say $pkg; ($pkg, $file, $line) = caller; say $pkg; say $file; say $line; } package Bar; Foo::foo(); # <実行結果> # $ p…

Plagger:ログ出力レベル

sub log { my($self, $level, $msg, %opt) = @_; return unless $self->should_log($level); ・・・ } my %levels = ( debug => 0, warn => 1, info => 2, error => 3, ); sub should_log { my($self, $level) = @_; # $level: 出力しようとしているログ出力…