in reply to String in array

Just try some print(tm)-debugging:

my ($cmd, $chdir) = split(';',$run[$element],2);

becomes

print '@run:', join ', ', @run, "\n"; print "\$element: $element\n"; my ($cmd, $chdir) = split(';',$run[$element],2); print "\$cmd: $cmd\n"; print "\$chdir: $chdir\n";

You'll be surprised when you discover how many problems you can solve on your own using this technique.