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

Re^4: Split a string based on change of character

by Skeeve (Vicar)
on Jul 28, 2007 at 15:28 UTC ( #629296=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Split a string based on change of character
in thread Split a string based on change of character

But $i^=$i makes $i 0 at once. So it's different to $i=!$i

Back in the ancient times of C64 Basic I used j=1-j


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e


Comment on Re^4: Split a string based on change of character
Select or Download Code
Re^5: Split a string based on change of character
by eyepopslikeamosquito (Canon) on Jul 29, 2007 at 02:43 UTC

    I think ikegami meant $i^=1, i.e.:

    my @words = grep $i^=1, split /(?<=(.))(?!\1)/, $string;
    which does work.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://629296]
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: (3)
As of 2015-07-06 00:14 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