#! perl -slw use strict; #use Inline 'FORCE'; use Inline C => 'DATA', NAME => 'IC_junk1', CLEAN_AFTER_BUILD => 0; test( 'fred' ); test2( 'fred' ); __DATA__ __C__ #include #include void eprintf (const char *template, ...) { va_list ap; va_start( ap, template ); vfprintf( stderr, template, ap ); va_end( ap ); } void test ( char* text ) { printf( "Got:'%s'\n", text ); printf( "stderr via PerlIO macro: %x\n", stderr ); printf( "stderr via Win32_stderr: %x\n", win32_stderr() ); } void test2 ( char* text ) { // eprintf( "Get:'%s'\n", text ); fprintf( win32_stderr(), "Get:'%s'\n", text ); } /* Outputs: C:\test>IC-junk1.pl Got:'fred' stderr via PerlIO macro: 77c5acc0 stderr via Win32_stderr: 77c5acc0 then segfaults when fprintf( stderr, .... ) is called. */