Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: read()

by Anonymous Monk
on Jun 08, 2007 at 03:10 UTC ( #619941=note: print w/replies, xml ) Need Help??


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 <>;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://619941]
help
Chatterbox?
[Eily]: I'm leaving too, bye!
LanX leaves with a song of the Chjuman League
[ambrus]: LanX: that's funny because it's actually the upper class that sleep in hotels, so they're the ones who should know how it's pronounced

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2017-03-27 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.