in reply to Redirection and encoding, broken or WAD?

Maybe I don't understand what you are trying to do ... but why not use a different file handle? You might consider redirecting STDOUT by using select:

open (FOOFILE, ">>:encoding(cp37)") or die "Some error message: $!\n +"; select FOOFILE; print "yadda yadda\n"; close(FOOFILE); select STDOUT;

No good deed goes unpunished. -- (attributed to) Oscar Wilde

Replies are listed 'Best First'.
Re^2: Redirection and encoding, broken or WAD?
by BillSeurer (Sexton) on Jan 05, 2006 at 20:52 UTC
    That doesn't capture other output (like from a system call). If you stick something like

    system "ls";

    in there in the original case the output from ls will go to the file (albeit not encoded) but using select it won't. I think they want this to work for all output going to the user's console device.