Using the perlio layer works fine for me:
#!perl -w
use warnings;
use strict;
use Inline C => Config =>
USING => 'ParseRegExp',
BUILD_NOISY => 1;
use Inline C => <<'EOC';
void foo(char * x, int y) {
PerlIO_write(PerlIO_stderr(), x, y);
}
EOC
my $str = "hello world\n";
foo($str, length($str));
foo($str, 8);
__END__
Outputs:
hello world
hello wo
Does that also work for you ? Is it acceptable ? (IIRC, you're not a big fan of the perlio layer.)
Alternatively, what about the XSubs warn() and/or vwarn() - both of which write to stderr ?
Cheers,
Rob