in reply to Extending an embedded Perl interpreter without a .pm file

Have you tried putting all the code for "DynTrans" in the first argument to eval_pv, but just as a perl script containing subroutines, not as a Package?
  • Comment on Re: Extending an embedded Perl interpreter without a .pm file

Replies are listed 'Best First'.
Re^2: Extending an embedded Perl interpreter without a .pm file
by ShodadVenturi (Acolyte) on Feb 08, 2005 at 17:55 UTC
    The problem with this is that the code that I want to add is written in C, not Perl. So I need the package to interface the C implementations into Perl callables. It's not just a matter of making these subroutines visible to Perl, but also linking them to the correct C functions. I assume that the .pm file is doing this somehow, but I don't know what the context is, it doesn't seem to be in the main namespace of the interpreter, or the eval_pv() trick described above would have worked.

    Thanks for the suggestions, though.