in reply to To Split or Not to Split
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: To Split or Not to Split
by tchrist (Pilgrim) on Apr 25, 2011 at 02:18 UTC | |
by Corion (Patriarch) on Apr 25, 2011 at 07:59 UTC | |
|
Re^2: To Split or Not to Split
by burningredmoon (Novice) on Apr 25, 2011 at 00:10 UTC |