in reply to Re: XS: use module into package
in thread XS: use module into package

But is there a use() function somewhere in the Perl API? I'm trying to avoid using eval.

Replies are listed 'Best First'.
Re^3: XS: use module into package
by ikegami (Patriarch) on Jun 13, 2011 at 18:27 UTC

    I don't think so, but it's moot. The reason you had to use eval in code doesn't go away by loading the module using a different interface. You can't go and change the package the parent Perl code was compiled into.

      But the code the eval executes is being parsed into a sequence of API calls that finally end up changing the caller package by using a module into it. I'm looking for these API functions.

      Except that maybe these are not "API" calls, but really internal stuff not meant for the general public.

        You can't go and change the package the parent Perl code was compiled into. You have to create new code and have it executed by Perl. Perl code gets compiled into ops, not API calls. package itself doesn't even result in an op because it's compiler directive. It changes the package Perl code gets compiled into.