
mhx
Enthusiast
/ Moderator
Apr 18, 2002, 3:10 AM
Post #2 of 3
(342 views)
|
|
Re: [shrimp_xia] a question about "read" function
[In reply to]
|
Can't Post
|
|
By default, open opens a file in text mode. You need to switch to binary mode:
open DDD,'test.txt'; binmode DDD; read DDD, $data, 7; close DDD; print $data; See [url=http://www.perldoc.com/perl5.6.1/pod/func/binmode.html]perldoc -f binmode for details. -- mhx
At last with an effort he spoke, and wondered to hear his own words, as if some other will was using his small voice. "I will take the Ring," he said, "though I do not know the way."-- Frodo
|