Open
Description
Hello everyone! I am interested in mixing compiled RPerl code with regular perl scripts (as a replacement for writing an XS module). I have this simple test RPerl module:
# [[[ HEADER ]]]
use RPerl;
package MyModule;
use strict;
use warnings;
our $VERSION = 0.001_000;
# [[[ CRITICS ]]]
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator
# [[[ SUBROUTINES ]]]
sub foo {
{ my void $RETURN_TYPE };
print "MyModule: foo()\n";
return;
}
I can compile this into c++ (MyModule.cpp
) using rperl MyModule.pm
.
Then, I have a regular Perl script p.pl
(not RPerl) where I would like to use the compiled RPerl module:
#! /usr/bin/env perl
use strict;
use warnings;
use lib '.';
# use MyModule; # <-- How to include the compiled RPerl module??
print "main: starting..\n";
MyModule::foo();
print "main: finished..\n";
How can I include the compiled RPerl module here?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels