Hi,


i am trying to write some data into the text file using PERL . In that file ^M is appeared on each line . Since i am new to PERL , i couldn't figure it out .

Guys please help me to fix this problem.

Recommended Answers

If you used a text editor to create the file, make sure it saves in Unix format.
If your code created the file, use \n for linefeeds instead of \r\n.
If you are sending the file via FTP, make sure it transfers in text/ASCII mode.

Jump to Post

All 3 Replies

If you used a text editor to create the file, make sure it saves in Unix format.
If your code created the file, use \n for linefeeds instead of \r\n.
If you are sending the file via FTP, make sure it transfers in text/ASCII mode.

If you used a text editor to create the file, make sure it saves in Unix format.
If your code created the file, use \n for linefeeds instead of \r\n.
If you are sending the file via FTP, make sure it transfers in text/ASCII mode.

Thanks for your answer.

Here code only created the file . I changed linefeeds \n into \r\n.

Most of the files its working properly , but very few files still has an issue.

I changed linefeeds \n into \r\n.

Reverse that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.