in reply to Perl Script to Run other Scripts with proper pauses?
As usual with perl, there is more than one way to do it. You might just use system to call a new perl process, but the more standard way to do it would be to use do. You can set @ARGV to define the parameters for the other scrips.
If other_script returns a true value (eg: the last line in other_script.pl is "1") then you can write:{ local @ARGV = ("Two", "Parameters"); do "other_script.pl"; } #here other_script's execution is done
Error information will likely be in $@, but you might need to check $!, read do's documentation for more detail.{ local @ARGV = (); do "other_script.pl" or die "Other script failed: $@"; }
Edit: the advantages of do over system are that it does not create a separate perl process, and the output is usable as perl data.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Script to Run other Scripts with proper pauses?
by haukex (Archbishop) on Jul 05, 2017 at 16:41 UTC | |
by Eily (Monsignor) on Jul 05, 2017 at 17:03 UTC |