Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Elegant way to split into sequences of identical chars?

by xdg (Monsignor)
on Nov 30, 2005 at 03:49 UTC ( #512842=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $line = "xx556xx";
    
    my @list = $line =~ m/((??{ $a = substr( $line, pos($line), 1); $a ? q
    +uotemeta($a) . '+' : '$' }))/g;
    
    print "@list";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2019-05-24 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (147 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!