2008-05-25から1日間の記事一覧
#!/usr/bin/evn perl use strict; use warnings; use Path::Class; file('tmp.txt')->touch; file('tmp.txt')->remove or die "can't delete file"; See also: http://d.hatena.ne.jp/perlcodesample/20080520/1211255597
#!/usr/bin/evn perl use strict; use warnings; use Path::Class; dir('foo','bar')->mkpath or die "can't create dir"; パス表現はPath::Classを使う事でCross Platformで扱う事ができます。See also http://d.hatena.ne.jp/perlcode…
こんなのをやりたいなぁと思っていたので、コンテンツの一部として少しずつ書いていこうと思います。perlcodesampleさんのは、割とプリミティブなものが多いので、Cookbookレベルのものにするかもしれません。また、Catalystグループ(catalyst.g.hatena.ne.j…
#!/usr/bin/env perl use strict; use warnings; use Path::Class; my $fh = file('tmp.txt')->openw; $fh->close; __END__ 作るだけであれば、touchでもよいと思います。See also: http://d.hatena.ne.jp/perlcodesample/20080519/1211252829
#!/usr/bin/evn perl use strict; use warnings; use Path::Class; use Perl6::Say; my $file = file( 'foo', 'bar', 'tmp.txt' ); say $file->basename; say $file->dir; __END__ See also: http://d.hatena.ne.jp/perlcodesample/…
#!/usr/bin/env perl use strict; use warnings; use Moose::Autobox; use Perl6::Say; my $mother_of = { Taro => 'Tomoko', Naoko => 'Shizuka', Kenji => 'Sayo', }; ### 1: ハッシュのすべてのキーを取り出す say $mother_of->k…
#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; use Perl6::Say; use Moose::Autobox; ### ハッシュのキーを削除するには、delete関数を使う。 my $math_score_of = { Aiko => 89, Kenta => 0, Taro => undef, }; #生徒の数学の点数 #1: …
http://perl-mongers.orgworemacx++, vkgtaro++perl-users、perl-mongersと色んなコミュニティがこうやってできるというのはいいことですね。こうやってコミュニティが増えていくことで、色んな人が参加できるようになるというのはとてもいいことなんじゃな…
メタプログラミングが簡単にできる Mixinベースの機能拡張ができる(多重継承よりbetter) OOが素直にできる(blessやらfuck) インターフェースによる実装の制約を実現できる 型による固いプログラミングができる などなどと色々と理由を書きたいところではあり…