Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: To Split or Not to Splitby FunkyMonk (Chancellor) |
on Apr 24, 2011 at 23:31 UTC ( [id://901115]=note: print w/replies, xml ) | Need Help?? |
Your question is so vague I don't know if this will help you or not
Use split when you know what to throw away and a capturing regex when you know what to keepI would love to attribute that quote to someone, but I've known it for so long I forgot who wrote it :( update: Following, tchrist's and Corion's comments I googled and I got the quote wrong, so I've added a word (s/regex/capturing regex/). I also found this link where Dominus attributes the quote to merlyn. I agree with all of tchrist's comments. Perhaps I should also add that it's a rule of thumb and not the law. It certainly helped me choose between using splits and captures when I was a Perl noob.
In Section
Seekers of Perl Wisdom
|
|