in reply to Flush all opened STDIO streams
use Inline C => <<'END_C'; void print_2() { fprintf(stdout, "2\n"); } END_C print STDOUT "1"; print_2(); print STDOUT "\n"; [download]
prints:
2 1 [download]
It says, that perl has its own system of stream buffering.