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 なぜかよく忘れる

クリップボード

mac

ファイルの内容をクリップボードに $ pbcopy < hoge.txt

screenrc

書いた # Ctrl-tに変更 escape ^Tt # 下にタブを表示 hardstatus alwayslastline "%w"

配列の区切り文字

print "@array";とかするときの配列要素の区切り文字は「$"」で変えられる。特殊変数の逆引きが欲しい。

プロトタイプ

#!perl use strict; use warnings; sub hoge (\[$@%]) { warn ref $_[0]; } my $scalar = 'scalar'; my @array = qw/1 2 3/; my %hash = ( key => 'value' ); hoge $scalar; # SCALAR hoge @array; # ARRAY hoge %hash; # HASH となる。 Readonlyで見た。

始める

何度目かのブログ始める