yah, your approach is the approach i tried as well, and i'm seeing the same "not a Math::BigInt::GMP object" business. Devel::Peek shows some interesting details, but i don't know this stuff deeply enough to interpret it:
0 dkg@pip:~$ perl -MDevel::Peek -e 'use Math::BigInt only => "GMP"; m +y $x = Math::BigInt->new(34); printf("%s\n", Dump($x));' SV = RV(0x907fe54) at 0x907fe48 REFCNT = 1 FLAGS = (PADMY,ROK) RV = 0x9065818 SV = PVHV(0x906ad24) at 0x9065818 REFCNT = 1 FLAGS = (OBJECT,OVERLOAD,SHAREKEYS) STASH = 0x90a0f30 "Math::BigInt" ARRAY = 0x90872d8 (0:6, 1:2) hash quality = 125.0% KEYS = 2 FILL = 2 MAX = 7 RITER = -1 EITER = 0x0 Elt "value" HASH = 0x1e720953 SV = RV(0x907fe24) at 0x907fe18 REFCNT = 1 FLAGS = (ROK) RV = 0x90656f8 SV = PVMG(0x90e21a4) at 0x90656f8 REFCNT = 1 FLAGS = (OBJECT,RMG) IV = 0 NV = 0 PV = 0 MAGIC = 0x9097ba0 MG_VIRTUAL = 0xb781aea0 MG_TYPE = PERL_MAGIC_ext(~) MG_FLAGS = 0x10 MG_PTR = 0x9083500 "" STASH = 0x91ab538 "Math::BigInt::GMP" Elt "sign" HASH = 0xe7455c8f SV = PV(0x9063748) at 0x9065998 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x90833b0 "+"\0 CUR = 1 LEN = 4 0 dkg@pip:~$
And here's the same thing with Math::GMP:
0 dkg@pip:~$ perl -MDevel::Peek -e 'use Math::GMP; my $x = Math::GMP- +>new(34); printf("%s\n", Dump($x));' SV = RV(0x868ce44) at 0x868ce38 REFCNT = 1 FLAGS = (PADMY,ROK) RV = 0x8672998 SV = PVMG(0x86cc918) at 0x8672998 REFCNT = 1 FLAGS = (OBJECT,IOK,OVERLOAD,pIOK) IV = 141099448 NV = 0 PV = 0 STASH = 0x86adf00 "Math::GMP" 0 dkg@pip:~$

In reply to Re^2: accessing mpz_t * of Math::BigInt::GMP from XS by dkg
in thread accessing mpz_t * of Math::BigInt::GMP from XS by dkg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.