i want to write a piece of code say comp.pl where i can pass one or more comma separated directories into a file and use that as INPUT to a called script runTest.pl .
here, directories contains multiple files having testcases
below, $runPath -> path for testcases file / directory containing such file
$runTest -> command line passed testcases file or command line passed directory where such multiple testcases files exist
my $testFile = ''; if (-f "$runPath/$runTest") { $testFile = "$runPath/$runTest"; } else { open (my $RF, '>', 'testFile'); print {$RF} map { "$_\n" } split(/,/, $runTest); close $RF; $testFile = "$runPath/$testFile"; } $status += utils::execCommand(Command => "$runTest.pl -f $testFile;
the above $status line is working fine when passing testFile from command line but not working when passing directory/directories.
example: comp.pl --runTest testDirectory1, testDirectory2so when i am executing the comp.pl script, it is not reading the files and its listed testcases under testDirectory1 and testDirectory2. it is just printing testDirectory1 and testDirectory2 line by line inside <testFile>
In reply to pass one or more directories into a file and use that as INPUT to a called script by noviceuser
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |