The first character should be whitespace or another delimiter to be kept.
Contents can be assumed cut and does not need an indicator.
my @order = sort { $b <=> $a } grep { length } @values;
if ($opt{trim}) {
my $trimpos = abs $opt{trim};
- length > $trimpos and substr($_, $trimpos - 1) = '…' for @lines;
+ $trimpos == 1 ? ($_ = substr($_, 0, 1)) :
+ (length > $trimpos and substr($_, $trimpos - 1) = '…') for @lines;
}
my $maxval = $order[0];