Hi Monks
Is there a way to get PV address like Devel::Peek do?
use Devel::Peek;
my $dd = "hello world\n";
Dump $dd;
#output:
SV = PV(0x55608d816050) at 0x55608d83a0a8
REFCNT = 1
FLAGS = (POK,IsCOW,pPOK)
PV = 0x55608d8b8e90 "hello world\n"\0
CUR = 12
LEN = 14
COW_REFCNT = 1
I found the above PV address from D::P output is 0x55608d8b8e90, but how can I get this address?
I tried SvPVX:
my $dd = "hello world\n";
printf("the dd string address is %x \n", cc($dd));
use Inline 'C' => <<'CODE';
unsigned int cc(SV* a){
40 return SvPVX(a);
41 }
42 CODE
# just print the dd string address is 8d8b8e90, the upper 4bytes of th
+e address was truncated.
So Is there a way to get pv address as an INT value like Peek does? Do I need to create a struct to save address?
TIA.
Regards,
I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction