#!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…
単語単位 行単位お初。
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…
#!perl use strict; use warnings; use utf8; my $str = 'カタカナ'; if ($str =~ /^\p{InKatakana}+$/) { warn 'match'; } else { warn 'not match'; } 初めて知った。 FormValidator::Liteのソースを読んでたら出くわした。 詳しくはperldoc perlunicodeあ…
起動したらF8連打
#!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 なぜかよく忘れる
ファイルの内容をクリップボードに $ pbcopy < hoge.txt
書いた # 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で見た。
何度目かのブログ始める