誰かが私に説明してもらえますか、それぞれどのようにstrtod
機能しますか。-locale10,2
にもかかわらず、なぜここに来るのですか?en_EN
#!/usr/bin/env perl
use warnings;
use 5.012;
use POSIX qw(locale_h strtod);
setlocale( LC_NUMERIC, 'en_EN.UTF-8' );
my $str = '5,6';
$! = 0;
my ( $num, $n_unparsed ) = strtod( $str );
if ( $str eq '' or $n_unparsed != 0 or $! ) {
die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
}
say $num + 4.6;
# 10,2