my $total = 0; # Total $total += $_->[1] for @items; # Parts (e.g. 1/10) $_->[2] = $_->[1] / $total for @items; # Greatest (for width) my $highest = 0; $_->[2] > $highest and $highest = $_->[2] for @items;