chomp doesn't return the chomped lines, they're modified "in place". It does, however, return the number of characters removed — which is what you're passing to the sort function in the second case, while you're discarding that value in the first case.
In reply to Re: Unexpected chomp behavior
by almut
in thread Unexpected chomp behavior
by saintex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |