While xms may not always be needed, that does not mean you should not bother using it UNTIL you need it. You will become confused when you forget to use a switch, wasting time debugging becuase you used x instead of xms.
If you use xms all the time, you will be consistent in your code and your expectations.
Using /xms by default only turns things around. It doesn't fix anything, except apparently many of Damian's regexes. I don't have any global statistics, but I do know for sure than in my code, I don't need /m and /s in more than 95% of all of my regexes.
/xms on by default just changes the default. Instead of turning flags on when you need them, you start turning them off when you don't need them. And you're caught in exactly the same debugging thing. Not that I ever spent a second debugging this, though: I'm very clear about what I expect. When I write /s, that's a clear indication of how I expect Perl to handle my ., and when I don't write /s, it's clear that I wanted the other thing.
/m communicates to the reader of the code that the string is
conceptually multi-line (as opposed to, for example: filenames, XML tags, etc...). Well, it used to, before PBP spread this
nonsense.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|