I think I'm about to lose my newly earned 'monk' status with this post, but here goes anyway. I use prototypes for any sub I write that does not take a scalar(s) as args. I do this for 2 reasons: First, it helps for readability of larger scripts, and just by looking at my sub prototypes at the top I know what to pass it.Second, for maintainability, when I look at stuff I wrote months ago I can see exactly what I'm passing and how to reuse that sub easily. Now this could also be because I write too much C, and like to see what is being passed around at a glance, personally, prototyping helps. Being able to pass an array ref (like you have to) in the same way I would (logically) pass an array (like I would want to) is also more readable for me.
"Nothing is sure but death and taxes" I say combine the two and its death to all taxes!
-
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.
|