0

I call the method account_balance which is in a Test.pm file from a srstest.pl file. I use GnuPG to sign my request which I send to the registrar. When I run srstest.pl I get the following error:

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

Line 1766 in the Test.pm file:

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

I do not understand what went wrong.

daxim
  • 39,270
  • 4
  • 65
  • 132
Cindrella
  • 1,671
  • 7
  • 27
  • 47

1 Answers1

3

Guessing from the error: extra_args should be an array reference, so you should pass the value as an anonymous array

extra_args => ['--no-secmem-warning']
choroba
  • 231,213
  • 25
  • 204
  • 289
  • Actually its working on other system. but tried this one also Getting ERROR gpg: no default secret key: No secret key gpg: [stdin]: clearsign failed: No secret key – Cindrella Jun 01 '12 at 10:23
  • Mohini, [open a new question](http://stackoverflow.com/questions/ask) for this unrelated problem. – daxim Jun 01 '12 at 10:41
  • opened a new question : http://stackoverflow.com/questions/10848883/how-to-deal-with-gnupg-error-gpg-no-default-secret-key-no-secret-key-gpg-st – Cindrella Jun 01 '12 at 10:56