If my example doesn't work for you, modify it accordingly.

That said, I don't see how it fails (as I don't know what you expect):

#!/usr/bin/perl -w use strict; my @unsorted = <DATA>; my @sorted = map {$_->[2]} sort {$a->[0] cmp $b->[0] || $a->[1] <=> $b->[1]} map {/(\D+)(\d+)/;[$1,$2,$_]} @unsorted; print for @sorted; __DATA__ test69.something-14-14 test28.something-14-14 foo52.something-14-14 test13.something-14-14 test4.something-14-14 foo58.something-14-14 test31.something-14-14 test15.something-14-14 test59.something-14-14 foo5.something-14-14 test41.something-14-14 test38.something-14-14 foo11.something-14-14 test10.something-14-14 test8.something-14-14 test49.something-14-14 foo24.something-14-14 foo7.something-14-14 bar27.something-14-14 bar0.something-14-14 test3.something-14-14 __END__ bar0.something-14-14 bar27.something-14-14 foo5.something-14-14 foo7.something-14-14 foo11.something-14-14 foo24.something-14-14 foo52.something-14-14 foo58.something-14-14 test3.something-14-14 test4.something-14-14 test8.something-14-14 test10.something-14-14 test13.something-14-14 test15.something-14-14 test28.something-14-14 test31.something-14-14 test38.something-14-14 test41.something-14-14 test49.something-14-14 test59.something-14-14 test69.something-14-14

The OP didn't

  1. contain filenames like "test69.something-14-14"
  2. specifiy that filenames as a composite of any number of fields of strings and digits were to be sorted string- and number-wise
  3. specify how non-letter and non-digits should be treated.

Bug reports without logs are useless.

Further recommended reading: I know what I mean. Why don't you?

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

In reply to Re^3: sorting numbered words by shmem
in thread sorting numbered words by Anonymous Monk

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.