以下是会产生错误的代码:
#!/usr/bin/env perl
use strict
use warnings FATAL=>'all';
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules())
{
my $version = $instmod->version($module) || "???";
print "$module -- $version\n";
}
只是不要使用“;” 在使用中严格
错误:
syntax error at ListModules.pl line 3, near "use strict
use warnings "
Execution of ListModules.pl aborted due to compilation errors.
Perl 版本信息:
This is perl 5, version 12, subversion 4 (v5.12.4) built for x86_64-linux-gnu-thread-multi