would it help if I add 'no integer;' at the beginning of the program?

I generally would not recommend making random changes - I would always rather actually understand the root cause of the problem first. You can at least do tests on your own system to see if, for example, setting environment variables allows you to replicate the behaviour that the user has reported.

I misspoke in my previous message: the environment variable I was thinking of is actually PERL5OPT. So here I see, for example:

% perl -wle 'print 3.9 * 3.9' 15.21 % export PERL5OPT='-Minteger' % perl -wle 'print 3.9 * 3.9' 9 % export PERL5OPT='-Mbigint' zen2% perl -wle 'print 3.9 * 3.9' 9 % export PERL5OPT='' % perl -wle 'print 3.9 * 3.9' 15.21 %

If such tests give behaviour that matches what your user reports, then it would be reasonable a) to report the contents of that environment variable at startup, and optionally b) to clear it. But don't get me wrong - I don't think it is highly likely that a strange setting of PERL5OPT is the cause, it's just one of the few things I can think of that could affect something as fundamental as Perl's arithmetic if the perl build is otherwise functional.

I don't have a Mac, but I think it is relatively unlikely that there is so fundamental a problem on all Macs of this sort; it is more likely something specific to the environment (in the general sense) of this user's system.


In reply to Re^3: weird problem with macports perl on apple m1/m2 based system by hv
in thread weird problem with macports perl on apple m1/m2 based system by perltux

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.