> bignum is meddling with the globals $Math::BigFloat::downgrade and $Math::BigInt::upgrade.

I haven't checked in detail yet (the code is a bit obscure) but this sounds reasonable.

But I disagree when you say

> There's really no way for bignum to do the right thing. It would have to muck around with those globals every time the flow of control entered or left its lexical scope. And the automatic upgrade feature was just a bad idea from the start. Solution: Don't use bignum, I'm afraid.

Athanasius point was not why bignum fails but why the use of pragma bignum is effecting a completely other package, since pragmas are guaranteed to be limited to a scope.

It's rather a limitation of BigFloat and BigInt to use global variable which keep their state even if the scope is left.

perlpragma shows a clear mechanism to limit effects to the scope using a pragma with the help of the hinthash %H .

Since "bignum is just a thin wrapper around various modules of the Math::BigInt family" those modules should be modified in a way to check a delegated hinthash when called from a pragma. (N.B. they share the same authors)

Hence a bug, in my humble opinion.

Anyway using globals for such profound effects is never a good idea.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

update

according to perlglossary#P

I'm not sure if bignum qualifies as a pragma, because of it's rather runtime effects.


In reply to Re^2: Pragma clash across modules: bignum and Math::BigFloat (hinthash) by LanX
in thread Pragma clash across modules: bignum and Math::BigFloat by Athanasius

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.