I don't know XS very well, but if you want to create a scalar from a char * and return it to Perl, here's a way to do it in Inline (which is much easier than XS):
#!/usr/local/bin/perl use strict; use warnings; use Inline C => <<'END_OF_C_CODE'; SV * get_string() { char string[] = "test"; SV *result = newSVpv(string, 0); return result; } END_OF_C_CODE my $string = get_string(); print $string;
(It's a bit verbose for clarity)
Cheers,
Ovid
New address of my CGI Course.
In reply to Re: Perlxs help please
by Ovid
in thread Perlxs help please
by mitchm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |