Re: Accessing variables from inside a C-XS

[email protected] (Oliver Seeliger)
Newsgroups perl.xs
Message-ID <[email protected]>
Hi,

 >>      SV*  perl_get_sv("package::varname", FALSE);
 >>
 >> This returns NULL if the variable does not exist.
 >>
 >> If you want to know if this variable (or any other SV) is actually
 >> defined, you can call:
 >>
 >>      SvOK(SV*)
 >
 > Note that this works for global (package) variables only.
 >
 > Is there a similar way to access lexical variables?

I'm not sure, but I don't really see the use of this approach.

What you want to do would be the same like trying to access a sub's 
variable from outside the sub. This doesn't make sense, does it?

Best regards,
Olli
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.