I am writing some perl which is giving me an error that I do not understand.

# x is 2 to the 128th my $x = Math::BigFloat->new(q(2.0)); $x->bpow(q(128)); # ...more stuff... # $product starts as x! $product = $x->copy(); $product->bfac();

The error I get is

Can't use an undefined value as an ARRAY reference at /System/Library/Perl/5.8.6/Math/BigInt/Calc.pm line 899 (#1) (F) A value used as either a hard reference or a symbolic referenc +e must be a defined value. This helps to delurk some insidious errors. Uncaught exception from user code: Can't use an undefined value as an ARRAY reference at /System/Libr +ary/Perl/5.8.6/Math/BigInt/Calc.pm line 899. at /System/Library/Perl/5.8.6/Math/BigInt/Calc.pm line 899 Math::BigInt::Calc::_acmp('ARRAY(0x18690a0)', 'ARRAY(0x18690d0)') +called at /System/Library/Perl/5.8.6/Math/BigInt/Calc.pm line 1304 Math::BigInt::Calc::_fac('Math::BigInt::Calc', 'ARRAY(0x1868fc8)') + called at /System/Library/Perl/5.8.6/Math/BigFloat.pm line 1789 Math::BigFloat::bfac('Math::BigFloat=HASH(0x1868f5c)') called at r +epeat.pl line 19

I have googled and not found this question asked before. Can anyone explain what is going wrong? Thanks.


In reply to undefined value as an ARRAY by mgwmgw

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.