Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: reduce like iterators

by moritz (Cardinal)
on Jan 03, 2011 at 19:20 UTC ( [id://880243]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub compress(*@a) {
        flat @a Zxx 1, (@a Zne @a[1..*-1])
    }
    
    say compress(<a a a a b c c a a d e e e e>).perl;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-26 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found