Maybe the title of your post should be I think I like Regular Expressions too much...

And maybe the title of my response should be I think sometimes I ramble on about unrelated things too much... :-)

Back when I had learned just enough Perl to be functional, I used to think in Regular Expressions all the time. They are simple, convenient, and powerful. They make a great hammer. They bend your mind into seeing all problems as nails. And, honestly, most problems can be bent into nails, when the hammer is Perl's regular expression engine.

After a while, though, I developed another sense of Perl. I discovered objects, and coderefs, and functional techniques, and index, and substr, and pack, and typeglobs, and tie, and a whole world of other things. I discovered that these other things can solve problems in ways that a regular expression anchored worldview is blind to.

Sure, I knew about of some of these things before I learned how to use regexes, but I didn't really understand them. I didn't realize that regexes were both a blessing and a curse.

Nowadays, I try to think about the problem first, and the solution second. I find that after clearly thinking about the problem, a solution will often simply drop out of the sky. This solution is then easily translatable into Perl, using one of the myriad of expressive tools available. Regexes are part of the toolset, and a very powerful tool indeed, but there are many other things there.


In reply to Re: I think I like Perl too much... by Mugatu
in thread I think I like Perl too much... by tlm

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.