>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?

Not necessarily. Let's assume I have code like this:

my $var = 'X';

myXSfunc();


In myXSfunc(), I want to access variable $var.

Yes, I know, I could pass it as argument and access it using @_, but this would 
be true for any global variable as well. Therefore, this isn't the question. 
The question is whether there is a function like perl_get_sv(), but for lexical 
variables?

Or, to think one more step further, see this code:

my $x = 1;
{
  my $x = 2;
  {
    my $x = 3;
    myXSfunc();
  }
}

It could be of interest for myXSfunc() to access not only the innerst-scope 
variable $x, but the outer-scope variables as well! 

Regards, Ferry
--

Ing. Ferry Bolhár-Nordenkampf
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-mail: ferdinand.bolhar-nordenka...@wien.gv.at

Reply via email to