Hi, everyone!
I'm trying to make some wrapper, but found something that I don't really understand. This is the test code:
This is the XS part
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
MODULE = xstest PACKAGE = xstest
SV*
new()
CODE:
HV* hv = newHV();
RETVAL = newSVrv((SV*)hv, NULL);
OUTPUT:
RETVAL
This is the perl part:
#!/usr/bin/perl
use common::sense;
use xstest;
my $obj = xstest::new();
say "object is: $obj";
I expect to have a hashref returned, but instead I got nothing. Why?