in reply to binmode(STDIN)

Try setting PERLIO=:raw before starting perl, but that may interfere with anything that doesn't want binmode.

Replies are listed 'Best First'.
Re^2: binmode(STDIN)
by PhilHibbs (Hermit) on Feb 10, 2005 at 09:55 UTC
    That works! Yayhay! I can do it safely, too, because it's a Windows Command Prompt script that runs perl with itself as input, so it can set PERLIO=:raw and then un-set it afterwards. [ysth]++!
Re^2: binmode(STDIN)
by PhilHibbs (Hermit) on Feb 10, 2005 at 14:15 UTC
    Hm. Now I get this:

    utf8 "\xFF" does not map to Unicode at C:\bin\hexdump.cmd line 40, <> chunk 2.

    Any suggestions?

    Update: This isn't caused by your sggestion, it happens whenever I pass the filename as a parameter rather than redirecting, though. Looks like another symptom of the same original problem.

    Update: I have fixed it by removing the use open ':utf8'; that I had added previously!

    Update: ARGH! Now it doesn't work for redirected input! That's OK, though, I can test for parameters before calling perl.