I will try to make a simple example code
Here is a simple demo:
use strict;
use warnings;
use Math::BigFloat;
my $n = Math::BigFloat->new(7);
my $k = 5;
print $n->bnok($k), "\n"; # prints "21".
my $n2 = 7;
print $n2->bnok($k); # line 10
It outputs:
21
Can't call method "bnok" without a package or object reference at bnok
+.pl line 10.
No problem with the first bnok call, but the second fails because $n2 is not a Math::BigFloat object - and this supports the assertions already made by others in this thread.
Apparently, $k doesn't need to be a Math::BigFloat object (though I think you'll find it can be).
Cheers, Rob |