Using "system" command - is it "bad practice" for perl?

From: John Davis (tudmuf2b_at_onebox.com)
Date: 09/28/04


Date: 27 Sep 2004 16:49:48 -0700

A couple of quick questions, it is considered "bad" perl programming
(from a style perspective) to ever use the system() command to call
UNIX level commands in a script, or should the "backtick"/exec method
be used at all times (if possible).

I was working on a piece of code today and realized that after the
running the system commands as follows:

system "co -l /src/test-script2.pl"; # to checkout for RCS
system "vi /src/test-script2.pl"; # edit and process it and return
back

*** IT NEVER COMES BACK from the vi command!

system "ci -u /src/test-script2.pl";

foreach @x {
   blah blah blah...
}

It did not return "control" back to my script and I had to Control-C
out of this script, and got frustrated at the system command. Is this
supposed to happen? Because in a ksh script, after doing a "vi", I
should get back to where I need to be.

Thanks!



Relevant Pages