# encoding: Windows1254
# This file is encoded in Windows-1254.
die "This file is not encoded in Windows-1254.\n" if q{‚ } ne "\x82\xa0";

use Windows1254;
print "1..2\n";

my $__FILE__ = __FILE__;

my $input = '  My name is Yamada Taro';

my $space = ' ';
my $a = join '_', split $space, $input;
if ($a eq 'My_name_is_Yamada_Taro') {
    print qq{ok - 1 $^X $__FILE__\n};
}
else {
    print qq{not ok - 1 $^X $__FILE__\n};
}

my $b = join '_', split ' ', $input;
if ($b eq 'My_name_is_Yamada_Taro') {
    print qq{ok - 2 $^X $__FILE__\n};
}
else {
    print qq{not ok - 2 $^X $__FILE__\n};
}

__END__
http://d.hatena.ne.jp/syohex/20130613/1371103504

•ÏX“_

split‚Ì‘æˆêˆø”‚ɋ󔒈ꂂ̕¶Žš—ñƒŠƒeƒ‰ƒ‹‚ð—^‚¦‚½‚Æ‚«‚Æ

‹ó”’ˆê‚‚ª‘ã“ü‚³‚ꂽ•Ï”‚ðŽw’肵‚½‚Æ‚«‚Ì‹““®‚ª¡‚܂ňá‚Á‚Ä

‚¢‚½‚Ì‚ª“¯‚¶‚É‚È‚Á‚½‚悤‚Å‚·B

Perl 5.16.3‚Å‚ÌŒ‹‰Ê
  a = __My_name_is_Yamada_Taro
  b = My_name_is_Yamada_Taro

Perl 5.18.0‚Å‚ÌŒ‹‰Ê
  a = My_name_is_Yamada_Taro
  b = My_name_is_Yamada_Taro

‚Þ‚µ‚ë 5.18.0‚æ‚è‘O‚Í‚»‚ñ‚È‹““®‚¾‚Á‚½‚Ì‚©‚Æ‚¢‚¤Š´‚¶‚Å‚·‚ªA

ˆê‰ž’m‚Á‚Ä‚¨‚¢‚½•û‚ª—Ç‚³‚»‚¤‚Å‚·B