For small projects self-documenting code usually works well enough. Choose good variable names and append descriptors like "_aref" for array references, "_href" for hash references, etc. If you are passing a lot of variables in or you feel like you need to heavily document what is being passed in then you could probably do with so some code code refactoring. An obvious one is if you are passing in a lot of variables then think about putting them into a hash and then just passing in a reference to the hash instead (this also makes it easier to add new variables/hash entries as your code evolves). If you want some additional documentation then put in some POD above the subroutine explaining what is does, what it takes/expects, returns, etc. You might also want to check out Perl Best Practices.
 

Elda Taluta; Sarks Sark; Ark Arks


In reply to Re^3: can't modify anonymous hash ({}) in scalar assignment by Argel
in thread can't modify anonymous hash ({}) in scalar assignment by Anonymous Monk

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.