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

Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

by eyepopslikeamosquito (Chancellor)
on Aug 12, 2007 at 07:35 UTC ( #632023=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $s = "ZBBBCZZ";
    my @x;
    push @x, $1 while $s =~ /((.)\2*)/g;
    
  2. or download this
    s = "ZBBBCZZ"
    x = []
    s.scan(/((.)\2*)/){x.push [$~[0]]}
    
  3. or download this
    import itertools
    s = "ZBBBCCZZ"
    x = [''.join(g) for k, g in itertools.groupby(s)]
    
  4. or download this
    group "ZBBBCCZZ"
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://632023]
Approved by bingos
Front-paged by clinton
help
Chatterbox?
[LanX]: interesting the author doesn't seem to accept javascript as a scripting language
[LanX]: ... and calls php7 the winner oO
[RonW]: RPerl is only a curiosity to me. I can see where some one who primarily codes in Perl might find RPerl useful, but to me, given the choice between RPerl's restrictions and C, I'd choose C

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2017-05-22 20:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?