Howdy monks.

I've run into a bit of a quandary. I've decided to write a simple guestbook for my website, and I want to use a flat file text database so I don't have to use up more space on jcwren's server than I need to, and, I haven't done flat file work in ages, so I thought it would be good excercise.

Now, I can write to, read from, even possibly replace and delete some text (a stretch...but hypothetically possible by me, but I'm notoriously terrible at regexen) from a text file (delimited by some convenient character.) However, I have no clue how to construct any sort of regex to match terms from a search against a text file.

So I've thought, "Well I could cheat, and use something like DBD::CSV, or I could actually learn how to do it." My question is, should I do it myself in this case, or should I just cheat (because I obviously SHOULD learn to do it myself, at some point in time at least)?

If one looks at the pro's/cons, some pros of doing it myself would be:

  1. I know how to, and wouldn't have to post about it in the future,and
  2. 2. I could possibly understand the modules that already do it out there better.
Some cons of doing it myself might be:
  1. I could make a mistake,
  2. re-invent the wheel, and
  3. waste time.

Your feedback is greatly appreciated monks.

meh.

In reply to To learn to search flat files or to cheat... by stonecolddevin

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.