Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Seeking a better way to do it

by 7stud (Deacon)
on Feb 01, 2013 at 05:37 UTC ( #1016448=note: print w/ replies, xml ) Need Help??


in reply to Seeking a better way to do it

use strict; use warnings; use 5.012; #for say() my $text = "Enter Iago, Othello, and others"; while ($text =~ / \s+ #A space one or more times ( #Start of $1 [^,]+ #Not a comma, one or more times ) #End of $1 , #A comma /gxms #(g)lobal matching plus standard xms ) { say $1; } --output:-- Iago Othello

Given a string: Enter Iago, Othello, and others I want to extract "Iago" and "Othello" to a data structure.

No data structure :(. Reputation--.


Comment on Re: Seeking a better way to do it
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-07-05 21:05 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 (68 votes), past polls