Some replies to your node have said something along the lines of "map/grep are not obscure, of course you should use them." I totally agree with that, for simple uses. Any novice perl programmer who comes across code that uses 'map' simply can easily look it up to figure out what it does. However, 2 things you said make me think your fears of maintainabily were well-founded:

1. You consider yourself one of the most advanced perl programmers at your company.
2. You needed to post a question to perlmonks to figure out how to write the code.

What I usually do when I've written something that took me a while to figure out, or that I think might take someone else a while to figure out, is to comment my intentions. That serves at least 2 purposes well: 1) someone skimming the code can look at this section and quickly understand what it's supposed to do, without having to understand the code. 2) if someone needs to debug my code, they at least know what I intended, and can be sure that I wasn't relying on some side-effect, or counting on some behavior for some special case.

Also, if I got help understanding it from some online source or some book, I'll include a link or a book name & page number in the comment to help others.


In reply to Re: "advanced" Perl functions and maintainability by blahblahblah
in thread "advanced" Perl functions and maintainability by geektron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.