in reply to Any way to binmode <>

I'm not exactly sure what problems you are encountering, but this is what my usage of binmode would encompass:
 
unless (open (FH, "filename.ext")) { print STDERR "Cannot open file - ", $!, "\n"; exit 1; }; binmode (FH); while (<FH>) { ... your code follows ... };

 
You'll note that I have used just the file handle for as binmode argument and not the input channel. As always though, also look at perlfunc:binmode.
 

 
Ooohhh, Rob no beer function well without!

Replies are listed 'Best First'.
Re: Re: Any way to binmode
by Thelonius (Priest) on Aug 02, 2001 at 19:31 UTC
    I meant <> with the implicit ARGV which opens the series of files given as arguments to your program:
    unshift(@ARGV, '-') unless @ARGV; while ($ARGV = shift) { open(FRED, $ARGV); binmode(FRED); while (<FRED>) { ... # code for each line }

    But what I want to do is:

    use open IN => ':raw'; while (<>) { # code for each line }
    Just lazy, I guess.