If you're sure that there's always a period at the end of the string, use
'chop $str'.
If you want to be safe, use '$str=~s/\.$//'.

-----Original Message-----
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 1:29 PM
To: Perl Beginners
Subject: chompping periods


Is there a way to chomp a period?
Example:
this is a test.

to

this is a test

I just need to remove the period from the end of a string.

Thanks,
Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to