#!/usr/bin/perl use IO::Handle; use Inline (Config => DIRECTORY => '/tmp/Inline', ); use Inline 'C'; my $out = new IO::Handle(); tie *$out, "MyFH"; print $out "Content-type: text/html\r\n\r\n"; my_print($out); package MyFH; sub TIEHANDLE { my $class = shift; open my $fh, ">", "test.out" or die $!; bless $fh, $class; } sub PRINT { my $self = shift; print $self @_; } __END__ __C__ void my_print(PerlIO *fh) { PerlIO_puts(fh, "TEXT"); }