in reply to Executing multiple perl scripts by master script.
Your code will execute 9 scripts in sequence. If your code does not do what you want it to do, please explain how it differs from your expected behavior.use strict; use warnings; my $generatorDir = './processing'; my @rprtname = 1 .. 9; for (@rprtname) { `perl $generatorDir/$_.pl`; }
An enhancement would be to use system instead of backticks, and check the status of each command.
system "perl $generatorDir/$_.pl" and die "Error running $_.pl $?" +;
Updated above code to replace $! with $? (thanks AnomalousMonk).
|
|---|