怎麼可能在日期/ Manip.pm的代碼塊從Date::Manip模塊:當我使用Date :: Manip的sortByLength時,爲什麼會得到「未初始化值」警告?
#*Get rid of a problem with old versions of perl
no strict "vars";
# This sorts from longest to shortest element
sub sortByLength {
return (length $b <=> length $a);
}
use strict "vars";
我得到這樣的警告:
Use of uninitialized value in length at /perl/lib/perl5.8/Date/Manip.pm line 244.
這是一個警告,而不是一個錯誤,它可以通過不傳遞「undef」到該函數來解決。 – jrockway 2009-08-12 02:40:06