Assuming you have your "number of arrays" stored as an array of arrays:

#! perl -slw use strict; use Data::Dump qw[ pp ]; my @AoAs = ( [ qw[ TTVVRRRDR KFRQLLWFH RSQSPRRRR CSPHHTALR WIRTPPAYR VVRRRDRGR +HISCLTFGR RTPSPRRRR NTNMGLKFR LVSFGVWIR ] ], [ qw[ AILCWGELM TVLEYLVSF GLKFRQLLW LSFLPSDFF LLSFLPSDF LLWFHISCL +MQLFHLCLI QLFHLCLII ATVELLSFL ALRQAILCW ] ], [ qw[ TTVVRRRDR CSPHHTALR WIRTPPAYR NVNMGLKIR LVSFGVWIR HISCLTFGR +] ], [ qw[ CSPHHTALR YVNTNMGLK WIRTPPAYR TLPETTVVR HISCLTFGR NTNMGLKIR +WGMDIDPYK LVSFGVWIR ] ], ); my %freq; map ++$freq{ $_ }, @$_ for @AoAs; @$_ = sort{ $freq{ $b } <=> $freq{ $a } } @$_ for @AoAs; pp \@AoAs __END__ C:\test>1169316 [ ["CSPHHTALR", "WIRTPPAYR", "HISCLTFGR", "LVSFGVWIR", "TTVVRRRDR", "K +FRQLLWFH", "RSQSPRRRR", "VVRRRDRGR", "RTPSPRRRR", "NTNMGLKFR"], ["AILCWGELM", "TVLEYLVSF", "GLKFRQLLW", "LSFLPSDFF", "LLSFLPSDF", "L +LWFHISCL", "MQLFHLCLI", "QLFHLCLII", "ATVELLSFL", "ALRQAILCW"], ["CSPHHTALR", "WIRTPPAYR", "LVSFGVWIR", "HISCLTFGR", "TTVVRRRDR", "N +VNMGLKIR"], ["CSPHHTALR", "WIRTPPAYR", "HISCLTFGR", "LVSFGVWIR", "YVNTNMGLK", "T +LPETTVVR", "NTNMGLKIR", "WGMDIDPYK"], ]

Update: you might want to include a tie-break for those with an equal frequency to ensure consistency. Eg. Here I've used increasing aplha ordering as the tie break which makes the output more consistent:

#! perl -slw use strict; use Data::Dump qw[ pp ]; $Data::Dump::WIDTH = 200; my @AoAs = ( [ qw[ TTVVRRRDR KFRQLLWFH RSQSPRRRR CSPHHTALR WIRTPPAYR VVRRRDRGR +HISCLTFGR RTPSPRRRR NTNMGLKFR LVSFGVWIR ] ], [ qw[ AILCWGELM TVLEYLVSF GLKFRQLLW LSFLPSDFF LLSFLPSDF LLWFHISCL +MQLFHLCLI QLFHLCLII ATVELLSFL ALRQAILCW ] ], [ qw[ TTVVRRRDR CSPHHTALR WIRTPPAYR NVNMGLKIR LVSFGVWIR HISCLTFGR +] ], [ qw[ CSPHHTALR YVNTNMGLK WIRTPPAYR TLPETTVVR HISCLTFGR NTNMGLKIR +WGMDIDPYK LVSFGVWIR ] ], ); my %freq; map ++$freq{ $_ }, @$_ for @AoAs; @$_ = sort{ $freq{ $b } <=> $freq{ $a } || $a cmp $b } @$_ for @AoAs; pp \@AoAs __END__ C:\test>1169316 [ ["CSPHHTALR", "HISCLTFGR", "LVSFGVWIR", "WIRTPPAYR", "TTVVRRRDR", "K +FRQLLWFH", "NTNMGLKFR", "RSQSPRRRR", "RTPSPRRRR", "VVRRRDRGR"], ["AILCWGELM", "ALRQAILCW", "ATVELLSFL", "GLKFRQLLW", "LLSFLPSDF", "L +LWFHISCL", "LSFLPSDFF", "MQLFHLCLI", "QLFHLCLII", "TVLEYLVSF"], ["CSPHHTALR", "HISCLTFGR", "LVSFGVWIR", "WIRTPPAYR", "TTVVRRRDR", "N +VNMGLKIR"], ["CSPHHTALR", "HISCLTFGR", "LVSFGVWIR", "WIRTPPAYR", "NTNMGLKIR", "T +LPETTVVR", "WGMDIDPYK", "YVNTNMGLK"], ]

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Sort array using a ranking system from separate hash by BrowserUk
in thread Sort array using a ranking system from separate hash by Sandy_Bio_Perl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.