5
use DateTime::TimeZone::Local;
use Test::More tests => 1;
my @input = (1 .. 10);
my (@output) = sort {
DateTime::TimeZone::Local->TimeZone();
$a cmp $b
} @input;
is_deeply(\@output, \@input);
1..1
Can't return outside a subroutine at /usr/local/share/perl/5.8.8/DateTime/TimeZone/Local.pm line 72.
# Looks like your test exited with 9 before it could output anything.
shell returned 9
我已經確認並肯定它是一個子程序內。它不似乎是任何與使用的模塊,該代碼也導致了同樣的錯誤:
my @output = sort {
sub1();
} (1 .. 5);
sub sub1 {
eval "use ModuleDoesntExist";
return 1; # remove this and get a seg fault
}
看起來它是PERL比什麼都重要的錯誤。有任何想法嗎?更感興趣的是爲什麼發生這種情況而不是解決方法 - 只有當模塊不存在時纔會發生。
在這裏工作很好。 – cdhowie 2010-11-17 16:01:50
在Linux上運行,PERL版本5.8.8 - 你? :( – 2010-11-17 16:02:33
Debian Lenny,Perl 5.10.0。 – cdhowie 2010-11-17 16:04:17