Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: Split words

by ww (Bishop)
on Jul 11, 2012 at 15:18 UTC ( #981155=note: print w/replies, xml ) Need Help??

in reply to Re: Split words
in thread Split words

fails when the split word, monks, is repeated:
__DATA__ perl monks wisdom monks perl wisdom perl perl monks monks wisdom perl perl monks monks monkly wisdom

Replies are listed 'Best First'.
Re^3: Split words
by cheekuperl (Monk) on Jul 11, 2012 at 15:41 UTC
    Nice observation!
    However, for repeating "monks" all we need is this:
    while($line=<DATA>) { while($line=~m/monks/g) { print "\n==>$`\nmonks\n$'"; } }
    Now I've assumed prefix of "monks" means whatever precedes "monks" in the string (even if it contains previous "monks") Same goes for postfix.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981155]
[Corion]: Basically, something that decouples the HTTP parsing (+ determining whether to redirect, etc) from the IO
[Corion]: All clients I'm aware of don't do that but issue all IO themselves

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2016-12-07 15:52 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (130 votes). Check out past polls.