tags:

views:

60

answers:

1

In XS, how do I turn a string that holds a variable name into its address, I want to do something like the following perl code:

our $var = 1;
print ${$main::{var}};
+10  A: 

In perlguts, it says:

If you know the name of a scalar variable, you can get a pointer to its SV by using the following:

SV*  get_sv("package::varname", FALSE);
Axeman
Thanks, I was too lazy to look for it.
Chas. Owens
No problem. I'm not an RTFM-type of guy.
Axeman