Last active
August 29, 2015 14:10
-
-
Save trapple/18b6d43355d8ae41c17c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use utf8; | |
binmode STDOUT, 'utf8'; | |
main() unless caller; | |
sub main { | |
chomp(my $input = <STDIN>); | |
if( my $youbi_j = translate($input) ) { | |
print "$input は $youbi_j です\n"; | |
}else{ | |
print "変換できませんでした\n"; | |
} | |
} | |
sub translate { | |
my $str = shift; | |
my %youbi = ( | |
mon => '月曜日', | |
tue => '火曜日', | |
wed => '水曜日', | |
thu => '木曜日', | |
fri => '金曜日', | |
sat => '土曜日', | |
sun => '日曜日', | |
); | |
if( exists $youbi{$str} ){ | |
return $youbi{$str}; | |
}else{ | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment