in reply to spawning shell commands vs using Perl modules

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).

  • Comment on Re: spawning shell commands vs using Perl modules