The following code, as I'm sure one of you experts will know, is not executing as expected:
foreach (@cpus) {
$cpu = $_;
foreach (@prefixes) {
$prefix = $_;
}
`composer "cr $prefix$ssuffix from sched=$cpu#@"`;
`composer "cr $prefix$jsuffix from jobs=$cpu#@"`;
}
@cpus and @prefixes contain different values. What I was expecting to receive was the creation of two files for each $cpu, each beginning with the $prefix value from the @prefixes array and then ending with values of $ssuffix and $jsuffix as defined earlier in the script and then as derived from the "from" part of the composer line. As an FYI, composer is another program (non-perl and vendor written) that I'm executing to pull definitions from a database. Instead, what I wind up with is just the last two files from the last $cpu value. In short, it appears I'm over writing the files each iteration through and I'm not looping as expected.
Any and all help will be appreciated. Thanks in advance.
Start Free Trial