I'm saying that it can, for the OP's case, be trivially made easier to understand. It did take me a few minutes' head-scratching to see what it did, and it surprised me that the community's response about its clarity was positive.
In my case, I don't use the list-returning properties of regexps often, nor do I expect map to subtract from or add to the amount of elements in the array. If I need to kill elements, I generally leave a hint such as () inside the map block.
I do not view this behaviour as dumbing down code at all, but just saving people's heads from excess scratching, that they are able to instantly see what that line does. The Perl community does have a reputation of abstruse write-only code, you know, and I think this line would be a perfect example of excess terseness the community is infamous for. (For the record, I hate Java for its dumb verbosity. Middle grounds exist, too.)
-
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.
|