use strict; use warnings; my $year = 2120; print "$year is "; if (($year % 400) == 0) { print "uruu."; } elsif (($year % 100) == 0) { print "not uruu."; } elsif (($year % 4) == 0) { print "uruu."; } print "\n";
c:/dropbox/code $ perl uruuyear.pl 2000 is uruu. c:/dropbox/code $ perl uruuyear.pl 2100 is not uruu. c:/dropbox/code $ perl uruuyear.pl 2120 is uruu.
Windows には Strawberry Perl をインストールしている。その場合 shebang はどう書くのだろう。よくわからないけれど、いまのところは perl ファイル名 とタイプしていても苦ではないのでまぁいいか。