This is a long list of suggestions, only the last of which will start to answer your actual question.

use strict -- you have subroutines assigning values to undeclared variables which the main body then assumes exist when it goes to the next statement. It woould be clearer to have things like:
my %form; ($form{'First'}, $form{'Last'}) = parse_form("First", "Last");
and this brings up use CGI for parsing forms. It looks like this script attempts to parse form input on its own. A practice most Monks encourage avoiding when possible.

Finally, there is a module, DBD::CSV to treat CSV files as SQL capable databases. By using a module you make it possible to switch to a more powerful SQL backend at any time.

In spite of all this, I still don't understand why you can't simply abandon the line number scheme altogether. As you loop throught the lines of data (assuming they are ordered in the file), you should simply be able to start pulling out lines where the catalog numbers are within the range.

In reply to Re: More Flat-File Database Questions by ichimunki
in thread More Flat-File Database Questions 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.