I've read through this post a couple of times, and I don't quite see what your question is.

If you've got a 10k line flat-file, I think it's time for you to consider moving to a more flexible and robust database system. Mysql, PostgreSQL and the venerable Berkeley DB system are popular free (at least as in beer) options for you.

You "control number system" is essentially the unique primary key in your database. It's a pretty standard practice. In what way do you find it "cumbersome". If it's a problem with re-keying your database every time you add or remove an item, my advice is don't. When you remove an item, that primary key is gone forever, when you add an item, just increment your max primary key. Save a copy of the max primary key somewhere else so you don't need to run through your entire database to find out what it is. Since your primary query is by catalog number, keep your database sorted by that. (If I've guessed your problem wrong, then I apologize. :)

It also sounds like you have a database normalization problem that you'll want to address eventually, but I guess that can wait.

Update: sounds like you want to learn how to tie an array ... maybe check out DB_File.


In reply to Re: An odd flat file database question by eg
in thread An odd flat file database question by Stamp_Guy

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.