Sort-filevercmp

 view release on metacpan or  search on metacpan

lib/Sort/filevercmp.pm  view on Meta::CPAN

C</(?:\.[A-Za-z~][A-Za-z0-9~]*)*$/>, unless the strings to be compared are
equal with the suffixes removed.

=item 4

The first non-digit sequence of the first string is compared lexically with
that of the second string, with letters (C<a-zA-Z>) sorting first and other
characters sorting after, ordered by character ordinals. The tilde (C<~>)
character sorts before all other characters, even the end of the sequence.
Continue if the non-digit sequences are lexically equal.

=item 5

The first digit sequence of the first string is compared numerically with that
of the second string, ignoring leading zeroes. Continue if the digit sequences
are numerically equal.

=item 6

Repeat steps 4 and 5 with the remaining sequences.

=back

=head1 CAVEATS

This sort algorithm ignores the current locale, and has unique rules for
lexically sorting the non-digit components of the strings, designed for sorting
filenames. There are better options for general version string sorting; see
L</"SEE ALSO">.

=head1 BUGS

Report any issues on the public bugtracker.

=head1 AUTHOR

Dan Book <dbook@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2017 by Dan Book.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

=head1 SEE ALSO

=over

=item *

L<version> - for comparing Perl version strings

=item *

L<Sort::Versions> - for comparing standard version strings

=item *

L<Sort::Naturally> - locale-sensitive natural sorting of mixed strings

=back



( run in 1.812 second using v1.01-cache-2.11-cpan-56fb94df46f )