Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • My favorite PBP worst practice is adding /xsm to every regular expression. All of a sudden, regexes start to behave oddly, and when asked about this in code reviews, people can only say "Damian says to do that" but can't explain why they should or even what the options do (but hey, that's why I get paid to do code reviews :).

    It might be good to write new regexes with /x, but unless you want the features that /sm provides (that is, want to change the meaning of ., ^, or $), you need to stay away from them.

    • by rjbs (4671) on 2007.10.22 16:39 (#58520) Homepage Journal
      I'm torn. That's a good one, and more likely to be sort of insidious. I really take exception to some of the blanket "use wacky modules!" suggestions. tends, in my experience, to lead to heartbreak, or at least needlessly-inflated prereqs. The best case I saw was someone who'd uploaded a VERY simple, pure-core module to the CPAN, but then required and Smart::Comments. I mean, the beauty of Smart::Comments is that it won't be a prereq, isn't it?

      And then there's ... well, other modules. I'll stop before I get a head of steam going.