question on implementing C function with binary string as input and output

[email protected] (Perf Tech) Sun, 6 Apr 2014 11:13:07 -0500
Newsgroups perl.inline
Message-ID <CAL27a1440Hjkao_=fHbK1y2GYDEP_iRryVjadjF6wj30jLODcQ@mail.gmail.com>
https://metacpan.org/pod/Inline::C-Cookbook  has lots of good examples. But
I can't find an example on implementing a C function which takes a perl
string (may contain binary characters such as \x00 in the string) and
return another perl string (with binary characters).

In another word, the C function should have the similar syntax as the
following perl function.

sub myRepeat {
my $str = shift;
return $str . $str;
}

Thank in advance.


perl101Coder