2. run it at command line, warnings displayed:#!/usr/bin/perl # name: date.pl use strict; use warnings; use Date::Handler; use Date::Handler::Delta; my $delta = new Date::Handler::Delta([1,0,0,0,0,0]); my $date = new Date::Handler({ date => time } ); #$newdate is now one year in the furure. my $newdate = $date+$delta;
3. display OS locale parameters and modify the code,phillip@Athen:~/script$ perl date1.pl Locale en_US does not seem to be implemented on this system, keeping locale Locale en_US does not seem to be implemented on this system, keeping locale Locale en_US does not seem to be implemented on this system, keeping locale
phillip@Athen:~/script$ locale LANG=zh_CN.utf8 LANGUAGE=zh_CN:zh LC_CTYPE="zh_CN.utf8" LC_NUMERIC="zh_CN.utf8" LC_TIME="zh_CN.utf8" LC_COLLATE="zh_CN.utf8" LC_MONETARY="zh_CN.utf8" LC_MESSAGES="zh_CN.utf8" LC_PAPER="zh_CN.utf8" LC_NAME="zh_CN.utf8" LC_ADDRESS="zh_CN.utf8" LC_TELEPHONE="zh_CN.utf8" LC_MEASUREMENT="zh_CN.utf8" LC_IDENTIFICATION="zh_CN.utf8" LC_ALL=
4. run again:#!/usr/bin/perl use strict; use warnings; use Date::Handler; use Date::Handler::Delta; my $delta = new Date::Handler::Delta({ date=>[1,0,0,0,0,0], time_zone=>'Asia/Shanghai', locale=>'zh_CN.utf8', }); my $date = new Date::Handler({ date=>time, time_zone=>'Asia/Shanghai', locale=>'zh_CN.utf8', }); my $newdate = $date + $delta;
5. if add "#" to line:"my $newdate = $date + $delta;", save and run again. no warning messages. Phillipphillip@Athen:~/script$ perl date.pl Locale en_US does not seem to be implemented on this system, keeping locale Locale en_US does not seem to be implemented on this system, keeping locale
In reply to locale warnings when exec "+" op by PhillipHuang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |