Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: split every second word

by duff (Parson)
on Dec 05, 2003 at 00:21 UTC ( [id://312389]=note: print w/replies, xml ) Need Help??


in reply to split every second word

Not that it helps your particular problem (besides, I think you've been adequately answered), but this would be easy to implement using perl 6 in terms similar to how you framed your question:

@names = split m:each:2nd/\s+/, $string;

I.e., split the $string on each 2nd occurence of one or more whitespace characters.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-24 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found