SilvioCVdeAlmeida <[EMAIL PROTECTED]> writes:
>Hello,
>
>I have some obscure points around C function eval_pv.

I don't understand the question yet ...

>
>Specifically, I don't understand why eval_pv cannot access a pre-defined
>main::subroutine as it does for a packaged one, eg. pack::subroutine.
>
>In other words, why distinct eval_pv calls don't share the main scope,
>but do share package scope?

main:: _is_ a package, and it is shared exactly the same as all other 
packages. So I don't think the problem is what you think it is...

Are you calling sub as main::subroutine() or as subroutine() ?
XS code's "current package" is the current package of the calling perl 
code, NOT the package in which XS resides. (This is becuase 
current package is a per Current Op thing and XS doesn't have OPs
so last executed perl statement's one gets used.)

Another thing is that XS code has no "lexical scope" so my/our
declarations can't be seen.

>
>Perl docs tells nothing more than almost nothing about "eval_pv", so I
>would greatly appreciate some link/info about it.

Essentially it is "as if" the code that called your XS had done 

  eval "Some string";


Reply via email to