2012-06-01 119 views
0

我打電話的方法account_balance這是從srstest.pl文件Test.pm文件。我使用GnuPG簽署我發送給註冊服務商的請求。當我運行srstest.pl我得到以下錯誤:如何處理鼠標錯誤消息「ArrayRef'的驗證失敗」?

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', '[email protected]', '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: [email protected]\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 

Test.pm文件1766行:

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

我不明白什麼地方出了錯。

回答

3

從錯誤推測:extra_args應該是一個數組引用,所以你應該傳遞值作爲匿名陣列

extra_args => ['--no-secmem-warning'] 
+0

實際上它對其他系統的工作。但嘗試過這一個也得到錯誤gpg:沒有默認密鑰:沒有密鑰 gpg:[stdin]:clearsign失敗:沒有密鑰 – Cindrella

+0

Mohini,[打開新的問題](http://stackoverflow.com/questions/問)這個無關的問題。 – daxim

+0

開了一個新問題:http://stackoverflow.com/questions/10848883/how-to-deal-with-gnupg-error-gpg-no-default-secret-key-no-secret-key-gpg-st – Cindrella