Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Windows 中,行尾是 \r\n (x0dx0a) 例如(2 行文本) textfile.txt :
abc def
我最初认为每行的长度 == 5。但是当我尝试读取功能时,似乎我们需要考虑每行有 3 + 1 个字符(长度 == 4)。将换行符计为 1 个字符(作为 x0a)。
我想知道有没有办法让 perl 读取文件的每个八位字节(也读取 x0d)?
我不确定它是否有用,但我只是想知道^_^
谢谢
输入文件句柄上的binmode 。