in reply to regex question

This, to me, is definitely one of those “painful Perl lessons” that this language so-often gently teaches to all of us:   often, “jumping to an algorithm” equals “jumping to a conclusion” equals “making extra work for yourself!”

Let's face it:   we're taught to figure things out on our own. (In a University setting, to do anything else is called “cheating.”) So, as a result, we tend to re-invent the wheel. But CPAN gently and repeatedly teaches us to do otherwise.

CPAN serves to remind us all that, no matter what it is that we need to do, we do not all have to independently (re-)arrive at “how” to do it.

In short... we actually do not have to “figure out how to solve” a problem, in order to successfully solve it.

The practical implications of this are, actually, rather profound. Instead of “instinctively and reflexively fast-forwarding” from “the problem that now faces us” to “our first notion of how to solve it,” it behooves us to do something that we are not accustomed to do:   to regard the problem at hand, not as the inspiration for yet-another custom algorithm, but rather as a problem that has undoubtedly been solved a hundred times before. Our true objective, then, is just to find it.

Replies are listed 'Best First'.
Re^2: regex question
by afoken (Chancellor) on Jul 29, 2009 at 07:56 UTC
    ... but rather as a problem that has undoubtedly been solved a hundred times before. Our true objective, then, is just to find it.

    CPAN often has more than one solution, and the true problem then is to find the solution or implementation that fits best. Often, this means finding the fastest solution and / or the solution that can cope with huge ammounts of data, and / or simply the one that has the least number of critical bugs. Another restriction may be the lack of a C compiler, so XS-based modules can not be used unless someone else has already compiled them. (A typical problem with ActivePerl on Win32.)

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)