in reply to Using binmode on ARGV filehandle?

Simple. What you want is:
#!/usr/bin/perl use open IN => ":utf8"; # Now all file handles opened for input (including ARGV) # will use utf8 encoding unless told otherwise while (<>) { do_whatever( $_ ); }
If you want specifically want binmode (not utf8) use ":raw" instead. The book suggests this may only be workable in newer versions of Perl. Works for me using v5.8.5

Replies are listed 'Best First'.
Re^2: Using binmode on ARGV filehandle?
by graff (Chancellor) on Jun 02, 2006 at 22:36 UTC
    Aha! This seems to contradict some of the statements made in the older threads that tye had pointed to in his initial reply above. Given that those threads are a few years old now, it would seem that the problems cited back then have been fixed.

    Thanks! This appears to do what exactly I want, in both 5.8.7 and 5.8.8.