最近使っているPerlスクリプトのひな形

1
2
3
4
5
6
7
# utf8
use strict;
use warnings;
use YAML qw (Dump);
sub p (@) { print Dump(@_); }
use utf8;
binmode STDOUT => ':encoding(cp932)';
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# utf8
# http://wiki.bit-hive.com/tomizoo/pg/Perl%20%BD%CB%C6%FC%CC%BE%A4%CE%BC%E8%C6%C0
use strict;
use warnings;
use YAML qw (Dump);
sub p (@) { print Dump(@_); }
use utf8;
binmode STDOUT => ':encoding(cp932)';
use Calendar::Japanese::Holiday;
# 祝日一覧の取得
my $holidays;
p $holidays = getHolidays(2008, 5);
p $holidays = getHolidays(2008, 5, 1);
foreach my $month ( 1 .. 12 ) {
$holidays = getHolidays(2009, $month, 1);
p { month => $month, holidays => $holidays};
}
# 祝日かどうかの判定
p my $name = isHoliday(2007, 5, 5);
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy