my @files = glob("*"); my @sorted = sort { -s $a <=> -s $b } @files;