Working through Project Euler, I return the result as an array of bigints, but using it as an argument for max(), map() or anything from List::Util does not work. Here's the code:

# big_factors() is my sub finding all the primes of a number. my @result = big_factors(600851475143); say max @result;

I get this error, but Google has nothing for me:

Can't call method "can" on unblessed reference at C:/Languages/Perl/perl/lib/Math/BigInt.pm line 2693.

Using Data::Dumper shows me the actual integers, though. I'm at a loss: how can I operate on arrays of Bigints in Perl?

Edit 1: I'm using Strawberry Perl 5.14.2 (Windows, naturally).

Edit 2: Some interesting differences in output methods:

say "@result"; ARRAY(0x3faefc) 71 839 1471 6857 say $result[1]->numify; 71

This is indeed true.

print Dumper \@result;
$VAR1 = [ [], bless( { 'value' => [ 71 ], 'sign' => '+' }, 'Math::BigInt' ), bless( { 'value' => [ 839 ], 'sign' => '+' }, 'Math::BigInt' ), bless( { 'value' => [ 1471 ], 'sign' => '+' }, 'Math::BigInt' ), bless( { 'value' => [ 6857 ], 'sign' => '+' }, 'Math::BigInt' ) ];

In reply to List::Utils can't find max in array of BigInts by mgatto

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.