http://www.perlmonks.org?node_id=619941


in reply to Re: read()
in thread read()

Why can't you `my @data = <FILEHANDLE>;` for binary data? It won't exactly be logically split, but `my $r = join '', @data` works perfectly fine.... Of course, I wouldn't want a huge file in memory...

Replies are listed 'Best First'.
Re^3: read()
by alpha (Scribe) on Mar 11, 2008 at 09:26 UTC
    This way you effectively pwn all of the chr(10) in your binary file... which is bad. The better "slurping" solution is to undef$/ and then using <>;