in reply to XS/Inline::C concat *any* two SVs.
use warnings; use Inline C => Config => CLEAN_AFTER_BUILD => 0, BUILD_NOISY => 1; use Inline C => <<'EOC'; SV * foo1(SV * a) { SV * c = newSVsv(a); return c; } SV * foo2(SV * a) { return SvREFCNT_inc(a); } EOC $x = 'hello'; print foo1($x); print foo1(" world\n"); print foo2($x); print foo2(" world\n"); __END__ D:\pscrpt\inline>perl try.pl hello world hello world
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XS/Inline::C concat *any* two SVs.
by BrowserUk (Patriarch) on May 28, 2006 at 14:30 UTC | |
by vkon (Curate) on May 28, 2006 at 22:18 UTC |