in reply to Re^2: Determine whether file is dos or unix format
in thread Determine whether file is dos or unix format

I second of all of what you wrote in this detailed and precise post. Only I feel like adding for completeness that re binmode, an alternative is given by layers/disciplines, and an IMHO clear one in terms of readability intelligibility. And I'm keen on do too, so all in all I'd rewrite the above like
my $text = do { open my $fh, '<:raw', 'test_file.txt' or die "Unable to open input file: $!\n"; local $/; <$fh>; };

Replies are listed 'Best First'.
Re^4: Determine whether file is dos or unix format
by ikegami (Patriarch) on Nov 29, 2005 at 16:16 UTC

    my $text = do { ... };
    is slower than
    my $text; { $text = ...; }
    and requires twice as much memory.

    I agree that it looks nicer, and I usually use it for that reason.