in reply to Perl56.dll and STDOUT

close STDOUT;
open STDOUT, ">stdout.log";

works for mortal applications. Your embeded system could use:

open STDOUT, ">&4"; # i think
or
mkfifo              # if your system supports it. M$, not.
You can also reopen your own stdout in the C code portion. Then attach that file handle to your tty screen buffer.

Replies are listed 'Best First'.
Re: Re: Perl56.dll and STDOUT
by hsmyers (Canon) on May 02, 2003 at 21:22 UTC
    That would work if I could rewrite the perl buffer---but in a sense that would be cheating. I've found that the following code seems to do the trick:
    stream = freopen("data.txt","w+",PerlIO_stdout()); ASSERT(stream); setbuf(stream,mybuffer); memset(mybuffer,0,BUFSIZ);
    This gives me my own stdout buffer with which I can have my way! BTW this is not a console app, so there is no stdout, hence the use of PerlIO_stdout(). (thanks to podmaster and tye for that pointer...) So now I'll have one window for code, one for stdout, and one for stderr---or whatever! Joy!

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."