According to the doc of bigint, it claims that all operators are overloaded:
"All operators (including basic math operations) are overloaded."
But this gives error:
use strict;
use warnings;
use bigint;
print 2 ** 31 -1;
for (1 .. 2 ** 31 - 1) {
print ".";
}
Range iterator outside integer range at math1.pl line 6.
Be well,
rir
.. is not overloadable.Is this because the overload moudule doesn't allow for it, or because it's truly not overloadable? I'm honetsly curious...
thor
Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come
That was what I guessed, but I had the same thought as thor, which to me is more important.
There must be some technical difficulty underneath, that made them to choose a easy way out and disable the ability to overload range operator. But I am on the same page as thor, logically there is no ground for that, and hopefully this will be opened up in the future.
#!/usr/bin/perl
use strict;
use warnings;
use overload;
print +("$_ = ", $overload::ops{$_},$/) for (keys %overload::ops);
3way_comparison = <=> cmp
dereferencing = ${} @{} %{} &{} *{}
str_comparison = lt le gt ge eq ne
with_assign = + - * / % ** << >> x .
binary = & | ^
iterators = <>
unary = neg ! ~
special = nomethod fallback =
num_comparison = < <= > >= == !=
assign = += -= *= /= %= **= <<= >>= x= .=
mutators = ++ --
func = atan2 cos sin exp abs log sqrt int
conversion = bool "" 0+
perlmonks.org content © perlmonks.org and pg, rir, sk, thor
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03