I agree that do might be suitable and have advantages, but for the OP I have to point out some caveats: The code executed by the do will also see package variables from the surrounding scope, and will be sharing globals like $/ with the rest of the code. If one of the scripts sets these variables to something (without properly localizing it), it will affect all the other scripts. This is not the case with system, since it'll be a totally separate process. Here's how one might do that, with appropriatebasic error checking (see $^X, as well as system for how to interpret $?). It would be best if $scriptname were an absolute pathname.
system($^X,$scriptname,@args)==0 or die "$^X $scriptname failed, \$?=$?";
Of course, whether it is a good set-up to have one Perl script call several other scripts, instead of having one script (properly modularized) do it all, might be questionable in the first place.
In reply to Re^2: Perl Script to Run other Scripts with proper pauses?
by haukex
in thread Perl Script to Run other Scripts with proper pauses?
by adamZ88
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |