Stories
Slash Boxes
Comments
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.
 Full
 Abbreviated
 Hidden
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.

    Pe
    • 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.