CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Splitting off a character

 



yellowman
Novice

Dec 11, 2006, 6:27 AM

Post #1 of 3 (441 views)
Splitting off a character Can't Post

Can anyone tell me how to get rid of the parentheses in the lines below. It's Monday and I can't

think of the logic. I am guessing I would use split somehow.

word1 (some more words)

word2 (stuff)

word3 (some more stuff to look at)

Thanks.


KevinR
Veteran


Dec 11, 2006, 1:06 PM

Post #2 of 3 (438 views)
Re: [yellowman] Splitting off a character [In reply to] Can't Post


Code
my $word = '(foo bar)'; 
$word =~ tr/()//d;
print $word;

-------------------------------------------------


yellowman
Novice

Dec 11, 2006, 2:01 PM

Post #3 of 3 (436 views)
Re: [KevinR] Splitting off a character [In reply to] Can't Post

That worked like a charm. Thanks.Smile

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives