Shell Script formatting broken due to whitespace trimming

Yeah it's this one: cpu top 2 (and top 30) (toolbar widget preset)

(note the screenshot from an earlier version)

The script being this:

ps -A -o %cpu,comm | perl -naE '
BEGIN{$n=$c=0};
chomp;
$n+=$F[0];
$c+=$F[0] if /Chrome\.app/;
$p = m{/([^/]+)\.app/} ? $1 : m{/([^/]+)$} ? $1 : m{^\s*[\d.]+\s++(.*)} ? $1 : $_;
$p{$p}+=$F[0];
END{
  print
    join "\n",
    map {sprintf "%16s %5.1f", substr($_,0,16), $p{$_}}
    (sort {$p{$b} <=> $p{$a}} keys %p)[0,1];
}
'

I think it might be because of some changes to 3rd party libraries where they attempt to center the line and automatically trim spaces when doing that.