Since your programs are obviously decoupled enough, that there is no problem to shell out via system() to use them, I would change this only if you find that you are running into performance problems (such as when doing the system call frequently in a loop). After all, you already have your prog*.pl and they work, so I would be reluctant to change things without compelling reason. Also, it makes the prog*.pl be useful as individual pieces callable from the commandline - an advantage which you would loose when turning them into a sub.
In case you eventually think about adding a new prog134 to your existing set, you might, however, consider the following alternative:
Write a module SupaDupa134.pm containing the code of your new piece of marvel as a sub mynewsub134(). Use this module in your main application, where you can call the sub. In addition, write a standalone Perl program prog134.pl which doesn't do much more than
use SupaDupa134 qw(mynewsub134); mynewsub134(@ARGV);
Doing this, you have all the advantages of a sub, plus a command line version for your own use, but still only one place to maintain the actual code.

HTH,
Ronald
Ronald Fischer <ynnor@mm.st>

In reply to Re: alternative way to subs by rovf
in thread alternative way to subs by steph_bow

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.