foreach(@testarray) { my $returnCode = system("gnome-terminal --window-with-profile=test -e 'fio $fioconfigs{$_}'"); print "$returnCode = return code"; until ($returnCode == 0) { wait(); } }