s/\r\n/\n/g

If you want to replace it with a new lime ^M is \r\n 

-----Original Message-----
From: divya [mailto:[EMAIL PROTECTED] 
Sent: 03 September 2007 12:57
To: beginners@perl.org
Subject: how to remove ^M character from every line

Hi ,

A file generated on Windows machine is used on linux m/c while scripting.
A sample line from the file is as shown:

//-------------------------------------------------------^M
File name : project_name^M
.....

Now in the perl script how can I remove ^M without running the command
dos2unix.

Note: Trying to split the line whenever ^ detected is not working.

Looking forward for your response.

Thanks,
Divya


This e-mail is from the PA Group.  For more information, see
www.thepagroup.com.

This e-mail may contain confidential information.  Only the addressee is
permitted to read, copy, distribute or otherwise use this email or any
attachments.  If you have received it in error, please contact the sender
immediately.  Any opinion expressed in this e-mail is personal to the sender
and may not reflect the opinion of the PA Group.

Any e-mail reply to this address may be subject to interception or
monitoring for operational reasons or for lawful business practices.





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to