NAME
lensort - Sort lines of text by their length
VERSION
This document describes version 0.002 of lensort (from Perl distribution App-lensort), released on 2018-07-26.
SYNOPSIS
lensort [OPTION]... [FILE]...
Sample input:
one
two
three
four
Sample output (lensort
):
one
two
four
three
Sample output (lensort -r
):
three
four
two
one
DESCRIPTION
This utility sorts lines of text by their length. The default is shortest first (if --reverse
a.k.a. -r
is given, will show longest line first). Lines with same length will be sorted by appearance (first in first out).
EXIT CODES
0 on success.
99 on command-line options error.
OPTIONS
- --reverse, -r
-
Show longest line first instead of the default shortest line first. Also, under
-r
line that appears later will be shown earlier (last-in-first-out) instead of the default first-in-first-out.
FAQ
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/App-lensort.
SOURCE
Source repository is at https://github.com/perlancar/perl-App-lensort.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-lensort
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
SEE ALSO
To sort numerically or alphabetically, use the Unix command sort.
To print the longest line, you can use wc -L
.
To sort by several other criteria, check out sortsub and the various Sort::Sub::*
backend modules.
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2018 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.