tr/015//;

-Tom Kinzer

-----Original Message-----
From: Randy W. Sims [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 8:05 PM
To: David Inglis
Cc: [EMAIL PROTECTED]
Subject: Re: how to remove a ^M charaters from a variable


On 12/20/2003 8:21 AM, David Inglis wrote:

> I am reading in a csv file and it has a control character ^M at the end
> of each line how can I remove these charaters, I have tried the following
> and had no success.
> 
> $a=~s/\^M//;
> $a=~s/^M//;
> 
> 
> Any help appreciated thanks.
> 
> 

^M is the carriage return. Try s/\x0D//;

Regards,
Randy.


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



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


Reply via email to