0

我从文件account_balance中调用文件中的方法。我使用GnuPG签署我发送给注册商的请求。当我运行时,我收到以下错误:Test.pmsrstest.plsrstest.pl

Attribute (extra_args) does not pass the type constraint because: Validation failed for 'ArrayRef' with value --no-secmem-warning at /usr/local/lib64/perl5/Mouse/Util.pm line 361
Mouse::Util::throw_error('Mouse::Meta::Attribute=HASH(0x24d4970)', 'Attribute (extra_args) does not pass the type constraint beca...', 'data', '--no-secmem-warning', 'depth', -1) called at /usr/local/share/perl5/GnuPG/HashInit.pm line 6
GnuPG::HashInit::hash_init('GnuPG::Options=HASH(0x1dd69a0)', 'armor', 1, 'default_key', 'abc@test.com', 'homedir', '/root/.gnupg', 'extra_args', '--no-secmem-warning') called at /usr/share/perl5/vendor_perl/Test.pm line 1766
Test::_sign_client('Test=HASH(0x1db1d48)', 'REGISTRAR: 111111\x{a}REGISTRAR EMAIL: abc@test.com\x{a}P...') called at /usr/share/perl5/vendor_perl/Test.pm line 245
Test::account_balance('Test=HASH(0x1db1d48)', 'com') called at srstest.pl line 11

文件中的第 1766 行Test.pm

$gnupg->options->hash_init( armor   => 1,
    default_key => $registrar_email,
    homedir => $gpg_dir,
    extra_args => '--no-secmem-warning'
);

我不明白出了什么问题。

4

1 回答 1

3

从错误中猜测:extra_args应该是数组引用,所以你应该将值作为匿名数组传递

extra_args => ['--no-secmem-warning']
于 2012-06-01T10:16:32.040 回答