How to replace ^M with a new line in perl

后端 未结 5 1635
时光说笑
时光说笑 2021-01-13 19:21

My test file has \"n\" number of lines and between each line there is a ^M, which in turn makes it one big string. The code I am working with opens said file and should par

5条回答
  •  北荒
    北荒 (楼主)
    2021-01-13 20:16

    You might want to set $\ (input record separator) to ^M in the beginning of your script, such as:

    $\ = "^M";
    

提交回复
热议问题