in reply to How do I sort an array of arrays by array length

G'day wolfman77,

Welcome to the monastery.

In scalar context, @array_name evaluates to the number of elements in @array_name. You can sort your array like this:

my @sortedarray = sort { @$b <=> @$a } @array;

-- Ken

Replies are listed 'Best First'.
Re^2: How do I sort an array of arrays by array length
by wolfman77 (Initiate) on Feb 27, 2014 at 11:37 UTC
    That works great. Many thanks!