使用 PDL::Constants 而不使用 "Subroutine redefined"
use PDL::Constants without "Subroutine redefined"
为了能够使用 Perl 数据语言的常量 PI
,我 运行 和 perl -w
行:
use strict;
use warnings;
use PDL::Constants qw( PI );
但是,Perl 警告我:
Subroutine PDL::Constants::piddle redefined at /usr/lib64/perl5/vendor_perl/PDL/Constants.pm line 29.
Subroutine PDL::Constants::null redefined at /usr/lib64/perl5/vendor_perl/PDL/Constants.pm line 29.
Subroutine PDL::Constants::pdl redefined at /usr/lib64/perl5/vendor_perl/PDL/Constants.pm line 29.
Subroutine PDL::Constants::barf redefined at /usr/lib64/perl5/vendor_perl/PDL/Constants.pm line 29.
同样的警告出现,如果我 运行 来自 https://metacpan.org/pod/PDL::Constants#PI
的概要
use PDL::Constants qw(PI E);
print 'PI is ' . PI . "\n";
print 'E is ' . E . "\n";
导入PI等PDL常量值的正确方法是什么?
在最新的 PDL 中使用它:
perl -w -Mblib -MPDL::Constants -e 1
不产生任何警告。
为了能够使用 Perl 数据语言的常量 PI
,我 运行 和 perl -w
行:
use strict;
use warnings;
use PDL::Constants qw( PI );
但是,Perl 警告我:
Subroutine PDL::Constants::piddle redefined at /usr/lib64/perl5/vendor_perl/PDL/Constants.pm line 29. Subroutine PDL::Constants::null redefined at /usr/lib64/perl5/vendor_perl/PDL/Constants.pm line 29. Subroutine PDL::Constants::pdl redefined at /usr/lib64/perl5/vendor_perl/PDL/Constants.pm line 29. Subroutine PDL::Constants::barf redefined at /usr/lib64/perl5/vendor_perl/PDL/Constants.pm line 29.
同样的警告出现,如果我 运行 来自 https://metacpan.org/pod/PDL::Constants#PI
的概要use PDL::Constants qw(PI E);
print 'PI is ' . PI . "\n";
print 'E is ' . E . "\n";
导入PI等PDL常量值的正确方法是什么?
在最新的 PDL 中使用它:
perl -w -Mblib -MPDL::Constants -e 1
不产生任何警告。