Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: treat pairs, set as one item: looking for better way

by kcott (Abbot)
on Oct 19, 2013 at 07:00 UTC ( #1058880=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl -l
    
    ...
    for (sort { @$b <=> @$a } map { [ sort keys %$_ ] } @{$sets{data}}) {
        print join ',' => @$_;
    }
    
  2. or download this
    e,f,g
    a,b
    ...
    d
    h
    i
    
  3. or download this
    [
        { a => 2, b => 2 },
    ...
        { h => 1 },
        { i => 1 },
    ]
    
  4. or download this
    {
        a => $sets{data}[0],
    ...
        h => $sets{data}[4],
        i => $sets{data}[5],
    }   
    
  5. or download this
    sort { @$b <=> @$a } 
    
  6. or download this
    sort keys %$_
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1058880]
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: (15)
As of 2014-12-22 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (118 votes), past polls