2010-11-01から1ヶ月間の記事一覧

Text::Xslate::Syntax::Kolonについてメモ

今日覚えたこととか。 実はKolonとはあんまり関係ないかもしれない。 #!perl use strict; use warnings; use Encode; use Text::Xslate; use Data::Section::Simple; my $vpath = Data::Section::Simple->new()->get_data_section(); my $tx = Text::Xslate-…

リストに対してバックスラッシュを適用する

#!perl use strict; use warnings; my $scalar = 'one'; my @array = qw/two three/; my %hash = (four => 'five'); my @ref = \($scalar, @array, %hash); for (@ref) { print ref $_, "\n"; } # 出力結果 # SCALAR # ARRAY # HASH 各要素に対して適用され…

DBIx::Skinnyで取得結果をテンプレに渡すとき

#!perl use strict; use warnings; use DBIx::Skinny; use Text::Xslate; use Data::Section::Simple; my $vpath = Data::Section::Simple->new()->get_data_section(); my $tx = Text::Xslate->new(path => [$vpath]); { package MyModel; use DBIx::Skinny…

insert modeでの削除

vim

単語単位 行単位お初。

HTML::ShakanのconstraintsでKATAKANAとかを使う

package MyForm; use strict; use warnings; use HTML::Shakan::Declare; use FormValidator::Lite::Constraint::Japanese; form 'add' => ( TextField( name => 'katakana', constraints => [ 'KATAKANA' ], ), TextField( name => 'hiragana', constraints…

Unicodeブロック

#!perl use strict; use warnings; use utf8; my $str = 'カタカナ'; if ($str =~ /^\p{InKatakana}+$/) { warn 'match'; } else { warn 'not match'; } 初めて知った。 FormValidator::Liteのソースを読んでたら出くわした。 詳しくはperldoc perlunicodeあ…

セーフモード

起動したらF8連打

HTML::Shakanの使い方とか

#!perl use strict; use warnings; package My::Form; use HTML::Shakan::Declare; form 'add' => ( TextField( name => 'name', label => 'name', constraints => [ [ 'REGEXP' => qr/^[\w]+$/ ], ], ), ); package main; use CGI; use Text::Xslate qw/mar…

ディレクトリの容量を表示

memo # キロ $ du -k /home # メガ $ du -m /home なぜかよく忘れる