We don't bite newbies here... much | |
PerlMonks |
Re: I think I like Perl too much...by Mugatu (Monk) |
on Mar 31, 2005 at 01:25 UTC ( [id://443658]=note: print w/replies, xml ) | Need Help?? |
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 Section
Meditations
|
|