in reply to Problem with Encode::Guess

you forgot to binmode

Replies are listed 'Best First'.
Re^2: Problem with Encode::Guess
by jimhenry (Acolyte) on Nov 10, 2010 at 21:42 UTC
    What layer string should I pass to binmode in a context like this, where I don't (by definition) know what encoding the file I'm opening uses? Doing this:
    open FH, $_ or die qq(can't open "$_" for reading\n); binmode FH, ':raw'; my @lines = <FH>; close FH;
    has no effect on the program's behavior, and anything more specific than ":raw" would seem to entail a premature assumption about what encoding an unknown file uses.