Spawning via a shell is going to have an overhead, since it will actually invoke an instance of whatever shell is configured to execute the command. This is going to use memory, process space etc which is unnecessary - in the extreme this could tie up the machine if it is configured to have a limited number of processes available to users.

There can also be security issues if you try and pass arguments to anything spawned via a shell, esp if you let the users specify the arguments free text.

Also, it's going to be platform dependent - by using the appropriate modules,you should be able to move the code from *nix's to win32 to whatever fairly easily - this alone makes it worthwhile (imho).


In reply to Re: spawning shell commands vs using Perl modules by sch
in thread spawning shell commands vs using Perl modules by qadwjoh

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.