There are times to invent, or even re-invent wheels, but there are also times to learn how to fit an existing wheel to your wagon. There are a lot of existing wheels that fit this particular wagon and they are worth learning about almost as much as regexen.

A deciding criteria however may be that, while a ton of questions get asked here about how to apply regexen in various ways, many fewer questions arrise about using various DB techniques. If it is learning you want to do, browse the regexen questions here (and try to answer them without looking at the other answers in the first instance) to learn regexen. But open the DB can of worms to solve this particular problem. There are a number of data base modules that may be of interest, DBD::CSV obviously, but also DBD::SQLite and DBM::Deep are worth looking at for other ways to do it.

Both approaches involve learning stuff that will be bound to come in handy in the future, but regexen you should have plenty of opportunities to learn about. Finding excuses to learn DB techniques are a little rarer.


DWIM is Perl's answer to Gödel

In reply to Re: To learn to search flat files or to cheat... by GrandFather
in thread 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.