|
|
| P is for Practical | |
| PerlMonks |
Re: Best practice or cargo cult?by GrandFather (Saint) |
| on Jun 20, 2006 at 17:04 UTC ( [id://556528]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Anything done all the time "because someone said so" is "cargo cult". However, just because it is "cargo cult" doesn't mean it can't be a best practice. So the question more usefully becomes "Is always using xms on regexen a good idea?". Personally I can see the justification for generally using /x and /s - they tend to avoid surprises, like when a chunk of whitespace is a tab rather than the space expected and treating all characters in a non-special way (/s) saves involving a couple of brain cells during processing more often than it requires them. But /m is a beast of a different stripe requiring a significant switch of meaning for ^ and $. I haven't read the book (books are expensive here and Perl is something of a "sideline" for me) so I don't know the justification, but I'd be inclined to leave the /m switch off. DWIM is Perl's answer to Gödel
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||