Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: split on the pattern of '),('

by ikegami (Pope)
on Sep 30, 2012 at 05:41 UTC ( #996458=note: print w/ replies, xml ) Need Help??


in reply to Re^4: split on the pattern of '),('
in thread split on the pattern of '),('

For the input I gave, the code you gave produced:

GOT: (1,"(text GOT: text)", 123 GOT: 2,"(string)", 234 GOT: ...)

But surely, it should produce:

GOT: 1,"(text),(text)", 123 GOT: 2,"(string)", 234 GOT: ...


Comment on Re^5: split on the pattern of '),('
Select or Download Code
Re^6: split on the pattern of '),('
by tobyink (Abbot) on Sep 30, 2012 at 08:13 UTC

    Your first "GOT" line contains a substring "),(" thus it was not fully split on that substring.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
      Yes, and yours did split in the middle of the string.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2015-07-07 12:23 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 (88 votes), past polls