Perl6-One-Liners icon indicating copy to clipboard operation
Perl6-One-Liners copied to clipboard

examples that use "lines.max" for "longest line" are wrong

Open timo opened this issue 8 years ago • 0 comments

the max of a list of lines is the lexicographically last, for example if there's a single line in the file that starts with a z, it's quite likely to be the "max" even though it could be just one letter long.

instead, you want to use .max(*.chars), which will compare the number of characters of all lines to find the longest line.

timo avatar Oct 28 '17 01:10 timo