O'well, in typical fashion I found the answer to my own question. There still
might be an easier way to do it, but perlintern helped with the padlist
walking:
===
my $VAR3 = "abc3";
use Inline C => q{
#define PAD_LEN (av_len(PL_comppad_name) + 1)
SV * find_my_sv( char * name ) {
int i;
for( i=0; i < PAD_LEN; i++ ) {
AV ** elem = av_fetch(PL_comppad_name, i, FALSE);
if( elem && strEQ( SvPV(*elem,PL_na), "$VAR3" ) ) {
return PAD_SV(i);
}
}
return NULL;
}
void func3() {
printf("VAR3 = %s\n", SvPV(find_my_sv("$VAR3"),PL_na));
}
};
func3();
===
Thanks
-Cory