in reply to pass one or more directories into a file and use that as INPUT to a called script

>it is just printing testDirectory1 and testDirectory2 line by line inside <testFile>

Well, looks like that's what you told it to do here:

print {$RF} map { "$_\n" } split(/,/, $runTest);

If you want to get the contents of the directories, you'll need to checkout opendir or File::Find (and friends).

For the best line of help, post more code for context. Particularly your options processing. And be sure to use strict; and use warnings;.

Oh,

open (my $RF, '>', 'testFile');
Did you mean,
open (my $RF, '>', $testFile);