If your shell script is just a driver for a bunch of other programs which run pretty much in order with fairly static sets of command-line options, then it can be fairly long without being an issue at all.

Right; many scripts start life exactly like that. For example, "check out some files, run make, check condition X and scp files to server Y, update config file Z...". Many lines of the script are simply using external programs like cvs, scp, mysqldump, whatever. If it's just a page full of lines like that, I wouldn't want a long sequence of system calls in a Perl script.

But as time goes by, users want more and more little bits added here and there, and even though it's still primarily a "driver for a bunch of other programs", now it's starting to do a little more error checking, more branching, and repeated bits are put into functions.

This is primarily the case I'm asking about here. When it's a sort of gray area, and you know you could just dig in and update the shell script, but you also know that it really won't fix the more inherent problems that a rewrite in Perl would. Also you want less work for yourself the next time you get a feature request for said script.


In reply to Re^2: At what point do you rewrite that old shell script in Perl? by rudder
in thread At what point do you rewrite that old shell script in Perl? by rudder

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.