My humble apologies of this is a question beneath contempt in simplicity.

I am simply trying not to reinvent the wheel or oxcart here, and only come hither after weary hors on google in a fruitless pursuit.

What I am trying to do is sort out my copies of thousands of debian modules, keep the LATEST ones and move the older dups to another directory.

bar_123.10.0_deb foo_123.10.0_deb foo_123.2.8_deb

I can split by underscore, grab $2, split by dots, specially process or ignore $3 (and/or) $2 is it has anything non-mumeric - I'll deal with those another day.

I am looking for a 'uniq' type commad that will only spot foo (as having one or more duplicates on the first split $1 and then permit a real comparison of version numbers.

A simple sort may well fail here, for obvious reasons.

But... this is something that SHOULD HAVE been done many times before. I am certainly not requesting a script, but just a pointer to something I can learn from on this issue!

Perhaps it is already a module in the VCI::VCS libraries.

The problem for me is not as much in finding the answers, but learning to ask the right questions.....


In reply to File Parsing by kel

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.