raku, library was not found

Viewed 174

I was trying to execute this program in Raku but I got an error below: How should I provide raku with the perl library there; what to copy where ?

use Math::BigInt;
$i = Math::BigInt->new($string);
use Math::BigInt ':constant';
print 10**121900;

enter image description here

Could not find Math::BigInt in

EDIT

I have failed to run zef after installing it:

enter image description here

Failed to stat file: no such file or directory

EDIT

enter image description here

Failed to stat file: no such file or directory

1 Answers

Math::BigInt is a Perl module

  1. Inline::Perl needs to be installed in Raku
  2. Math::BigInt needs to be installed in Perl
  3. You need to tell Raku that it is a Perl module rather than the default of being a Raku module
use Inline::Perl5;
use Math::BigInt:from<Perl5>;

my $string = "121900";
my $i = Math::BigInt->new($string);

say 10**$i;

(Untested as I am away from my computer)

Of course that is rather pointless as Raku already supports large integers.

say 10**121900;
Related