Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Rosetta Code: Long List is Long -- dualvar

by eyepopslikeamosquito (Bishop)
on Dec 04, 2022 at 06:35 UTC ( #11148545=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -lae "$r{$F[0]}+=$F[1]}{print qq($_\t$r{$_})for sort{$r{$b}<=>$r{
    +$a}||$a cmp $b}keys %r" big1.txt big2.txt big3.txt >oneliner.tmp
    
  2. or download this
    sort{$r{$b}<=>$r{$a}||$a cmp $b}keys %r
    
  3. or download this
    sort{$r{$b}<=>$r{$a}}sort{$a cmp $b}keys %r
    
  4. or download this
    perl -MO=Terse -e "sort{$r{$b}<=>$r{$a}||$a cmp $b}keys %r"
    LISTOP (0x299c080) leave [1] 
    ...
            UNOP (0x2882f08) keys [11] 
                UNOP (0x2882f40) rv2hv [10] 
                    PADOP (0x2882f78) gv  GV (0x2654ae0) *r
    
  5. or download this
    perl -MO=Terse -e "sort{$r{$b}<=>$r{$a}}sort{$a cmp $b}keys %r"
    LISTOP (0x2940c18) leave [1] 
    ...
                UNOP (0x2940ad0) keys [11] 
                    UNOP (0x2940b08) rv2hv [10] 
                        PADOP (0x2940b40) gv  GV (0x26344d8) *r
    
  6. or download this
    perl -MO=Terse -e "sort{$r{$b}<=>$r{$a}}sort keys %r"
    LISTOP (0x29e2518) leave [1]
    ...
                UNOP (0x29e26d0) keys [8]
                    UNOP (0x29e2708) rv2hv [7]
                        PADOP (0x29e2740) gv  GV (0xec4098) *r
    
  7. or download this
    sort{$r{$b}<=>$r{$a}}sort{$a cmp $b}keys %r
    
  8. or download this
    sort{$r{$b}<=>$r{$a}}sort keys %r
    
  9. or download this
    use sort 'stable';
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2023-03-23 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?