This is an example where you should rewrite the entire shell script in Perl.
Agreed.
After being scarred by having to maintain an ugly 5000-line shell script (that started life as
a quick ten line script) I put forward a case that Perl
should almost always be preferred to Unix shell: Unix shell versus Perl.
The key reason is that Perl can comfortably scale to much larger scripts than shell.
And shell scripts have a way of growing ... and growing ... and growing ... until they become
maintenance nightmares. But by then how do you justify a rewrite?
The cost of rewriting, the opportunity cost of not working on something else,
and the risk of breaking previously working code in the rewrite.
So write it in Perl to begin with.
-
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.
|