Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: split every second word

by shockme (Chaplain)
on Dec 04, 2003 at 15:56 UTC ( #312229=note: print w/ replies, xml ) Need Help??


in reply to split every second word

broquaint is pretty much right on. Given your example input, it'll work.

As to removing spaces, the following will do it:

my $str = "Bob "; $str =~ s/\s$//; # or s/ $//; print "|$str|\n";

If things get any worse, I'll have to ask you to stop helping me.


Comment on Re: split every second word
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://312229]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (13)
As of 2015-07-03 11:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls