I second the advice of using DBM instead of flat files. Flat files tend to get quite messy, don't scale well, and are extremely difficult to maintain.

Been there, done that, got the scars to prove it. Yes, you don't really want to go down this road if you can help it.

However, if you are brave and insist on this approach, the sub-directory approach is the way to go. I would only recommend naming the subdirectories differently, to whit:

being => /www/search/b/e/ing.dat suing => /www/search/s/u/ing.dat

versus

being => /www/search/b/be/being.dat suing => /www/search/s/su/suing.dat

From bitter experience, I can tell you that one day someone will accidently copy files from one directory to another and your application will start to behave in an erratic manner that will be hard to track down.


--
g r i n d e r

In reply to Re: Re: Poor Person's Database by grinder
in thread Poor Person's Database by Cody Pendant

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.