I used to see code like this a lot - this is more or less how many people wrote Fortran. There are *lots* of variables being passed to most of the subroutines - COMMON blocks. There are many many lines each doing some simple arithmetical manipulation. The main control of program flow seems to be through a couple of globals - whatfound and whatfound0.
I could never fix, understand or maintain code in this style, and I used to rewrite it as it was ultimately less painful. It is faster to write code like this, for something that will only be done once. If it's going to be done twice, you should reconsider your basic design. Also if it doesn't currently work properly, as you suggest, a rewrite on more organised lines is probably the fastest way of fixing it.
--
Anthony Staines
-
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.
|