... all the solutions presented in this thread seem to use a numeric sort comparison, which will sort '4.2' adjacent to '4.20'.
Not the Schwartzian Transform solution I originally presented (Re: sorting an array with decimal points). Even though the OP is indeed unclear and speaks about decimal point numbers, I considered, given the data sample, that these were really version numbers, not decimal numbers, and sorted them accordingly. So that between 4.2 and 4.20, you might find, for example, 4.7, 4.8, and 4.18. This is again my ST solution with no change to the code except for the input data:
use strict; use warnings; use feature "say"; my @array = qw(Patch_11.4 Patch_1.0 Patch_4.22 Patch_3.1 Patch_5.0 Pat +ch_4.2 Patch_6.0 Patch_4.8 Patch_4.7 Patch_4.20 Patch_9.3 Patch_10.2 Pat +ch_11.2 Patch_4.18); @array = map { $_->[0] } sort { $a->[1] <=> $b->[1] or $a->[2] <=> $b->[2] } map { /Patch_(\d+)\.(\d+)/; [$_, $1, $2]} @array; say for @array;
And the output:
$ perl sort_versions.pl Patch_1.0 Patch_3.1 Patch_4.2 Patch_4.7 Patch_4.8 Patch_4.18 Patch_4.20 Patch_4.22 Patch_5.0 Patch_6.0 Patch_9.3 Patch_10.2 Patch_11.2 Patch_11.4
Now, of course, this assumption about version numbers may be wrong, only the OP can clarify that with certainty.

In reply to Re^2: sorting an array with decimal points by Laurent_R
in thread sorting an array with decimal points by levW

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.