Keep It Simple, Stupid | |
PerlMonks |
Re: Elegant way to split into sequences of identical chars?by Roy Johnson (Monsignor) |
on Nov 29, 2005 at 21:53 UTC ( [id://512782]=note: print w/replies, xml ) | Need Help?? |
I know, obfuscated != elegant. Nevertheless, I thought it was kind of neat.
The trick with $| is that it's a toggle, so grep throws away every other member of its input. The same thing could be done with a normal variable like so: or using split:
Caution: Contents may have been coded under pressure.
In Section
Seekers of Perl Wisdom
|
|