当我将我设置locale
为it_IT.UTF-8
(export LC_ALL=it_IT.UTF-8) 并运行此脚本时
#!/usr/bin/env perl
use warnings;
use 5.012;
use POSIX qw(strftime);
say strftime "%A %B %e %H:%M:%S %Y", localtime;
我得到这个输出:
martedì marzo 15 08:50:07 2011
但是阅读这个(来自The-use-locale-pragma):
By default, Perl ignores the current locale.
The use locale pragma tells Perl to use the current locale for some operations:
...
The POSIX date formatting function (strftime()) uses LC_TIME .
为什么我的语言环境设置会在不使用locale
编译指示的情况下影响 strftime 输出?