Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 romping around the Monastery: (14)
As of 2015-07-03 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls