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

Re^2: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

by jdporter (Canon)
on Aug 12, 2007 at 13:22 UTC ( #632054=note: print w/replies, xml ) Need Help??


in reply to Re: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
in thread Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

Excellent excellent excellent.
A solution to the order problem would be to use an order-remembering hash (e.g. Tie::IxHash). Or you could pluck out the even-numbered elements of the list, e.g.

$_ = 'abbbccddde'; @a = /((.)\2*)/g; @a = @a[ grep { not $_ & 1 } 0 .. $#a ];
A word spoken in Mind will reach its own level, in the objective world, by its own weight
  • Comment on Re^2: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://632054]
help
Chatterbox?
[Corion]: Hi all! After 13 years or so in the same room, I've now moved to a new room (one door further) - weird :-D
[moritz]: I had an office move too, two floors up
[moritz]: so far I've managed not to get into my old office by accident, but once it was close (already stopped at the wrong floor)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2017-10-17 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (224 votes). Check out past polls.

    Notices?