954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Writing data into the text file in perl , ^M problem

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.

cacofonix
Newbie Poster
5 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

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.

thines01
Postaholic
Team Colleague
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
 
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.

cacofonix
Newbie Poster
5 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 
I changed linefeeds \n into \r\n.

Reverse that.

thines01
Postaholic
Team Colleague
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: