<commit_before>class Inline::Perl5;

class Perl5Interpreter is repr('CPointer') { }

has Perl5Interpreter $!p5;
has Bool $!external_p5 = False;
has &!call_method;
has &!call_callable;

use NativeCall;

sub native(Sub $sub) {
    my $so = $*VM.config<dll>;
    $so ~~ s/^.*\%s/p5helper/;
    state Str $path;
    unless $path {
        for @*INC {
            if "$_/Inline/$so".IO ~~ :f {
                $path = "$_/Inline/$so";
                last;
            }
        }
    }
    unless $path {
        die "unable to find Inline/$so IN \@*INC";
    }
    trait_mod:<is>($sub, :native($path));
}

class Perl5Object { ... }
class Perl5Callable { ... }
<commit_msg>Fix p5helper.so not found after installation with current panda<commit_after>class Inline::Perl5;

class Perl5Interpreter is repr('CPointer') { }

has Perl5Interpreter $!p5;
has Bool $!external_p5 = False;
has &!call_method;
has &!call_callable;

use NativeCall;

sub native(Sub $sub) {
    my $so = $*VM.config<dll>;
    $so ~~ s!^.*\%s!p5helper!;
    my $base = "lib/Inline/$so";
    state Str $path;
    unless $path {
        for @*INC {
            if my @files = ($_.files($base) || $_.files("blib/$base")) {
                my $files = @files[0]<files>;
                my $tmp = $files{$base} || $files{"blib/$base"};

                # copy to a temp dir
                #
                # This is required because CompUnitRepo::Local::Installation stores the file
                # with a different filename (a number with no extension) that NativeCall doesn't
                # know how to load. We do this copy to fix the filename.
                $tmp.IO.copy($*SPEC.tmpdir ~ '/' ~ $so);
                $path = $*SPEC.tmpdir ~ '/' ~ $so;
            }
        }
    }
    unless $path {
        die "unable to find Inline/$so IN \@*INC";
    }
    trait_mod:<is>($sub, :native($path));
}

class Perl5Object { ... }
class Perl5Callable { ... }

{'fraction_non_alphanumeric': 0.15723923196678774, 'fraction_numerical': 0.00934094447327452, 'mean_word_length': 2.070063694267516, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1835084', 'n_tokens_mistral': 681, 'n_tokens_neox': 659, 'n_words': 169}