Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 musing on the Monastery: (4)
As of 2019-07-19 01:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?