sub val { m/([\d.]*)([BKMGTEPZY]?)/ and $1 * $scale{$2} } ... sort { val($a) <=> val($b) } ...