I must be missing something

Yes, cause they're equivalent. What makes you think it works with -Mbignum=a,50? (I was wonder wondering why you'd need to specify the accuracy in the first place since I thought it defaulted to infinite accuracy.)

$ perl -Mbignum=a,50 -wle'print hex("0xbe91cfb586466d02")' Integer overflow in hexadecimal number at -e line 1. Hexadecimal number > 0xffffffff non-portable at -e line 1. 1.37319851173781e+19

bigint doesn't affect strings, so it never comes into play in the above. Even if it did, hex is not something that can be overloaded, so it would fail anyway even if the string was converted into a BigInt.

$ perl -MMath::BigInt -wle'print hex(Math::BigInt->new("0xbe91cfb58646 +6d02"))' Integer overflow in hexadecimal number at -e line 1. Hexadecimal number > 0xffffffff non-portable at -e line 1. 9.18481776382103e+22

If you use the string as the second operand of something whose first operand is a Math::BigInt, it'll work.

$ perl -Mbigint -wle'print 0+"0xbe91cfb586466d02"' 13731985117378145538
The above is short for
$ perl -MMath::BigInt -wle'print Math::BigInt->new(0)+"0xbe91cfb586466 +d02"' 13731985117378145538
which implicitly does
$ perl -MMath::BigInt -wle'print Math::BigInt->new(0)->badd(Math::BigI +nt->new("0xbe91cfb586466d02"))' 13731985117378145538
so you could also use
$ perl -MMath::BigInt -wle'print Math::BigInt->new("0xbe91cfb586466d02 +")' 13731985117378145538

In reply to Re^7: converting large hex values by ikegami
in thread converting large hex values by Spooky

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.