in reply to 'use bignum' scoping question

Hi,

from perldoc bignum:

Please note the following does not work as expected (prints nothing), +since overloading of '..' is not yet possible in Perl (as of v5.8.0): perl -Mbignum -le 'for (1..2) { print ref($_); }'

this works:

for my $num (2..2) { $s = sqrt($num * 1); print Dumper(\$s); }

Cheers, Christoph

Replies are listed 'Best First'.
Re^2: 'use bignum' scoping question
by ikegami (Patriarch) on Jan 11, 2010 at 01:02 UTC

    And so does

    for my $num (2..2) { $s = sqrt(Math::BigFloat->new($num)); print Dumper(\$s); }

    That's what bignum does to constants.