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.

    People forget to read the first chapter of PBP, and just flip to a chapter and verse and recite from their new bible. :(
    • 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 modu
    • I've personally hated the /xsm recommendation because it means I then have to hunt through the expression to find if there are any uses of ^, $, ., or whitespace that are being modified. It's far easier to look at an expression and see that its flags are only set when meaningful.

      I think it's far easier anyway. I'm only one person.