I think ikegami meant $i^=1, i.e.:
which does work.my @words = grep $i^=1, split /(?<=(.))(?!\1)/, $string;
In reply to Re^5: Split a string based on change of character
by eyepopslikeamosquito
in thread Split a string based on change of character
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |