in reply to syntax error

Specific to the syntax error -- the curly brace above the else is closing the for() block, not the if() block. So you need another right curly brace there. Then, at the end, there are two right curly braces when you only need one. I reformatted the code to make it easier for me to understand:
if ( ! -f $BASEDIR/nbssoammsg/tdt/src/tdt9999.cxx ) { system ( qq(cd $BASEDIR/nbssoammsg/tdt/src)); for $TDT (split/\s+/,`ls *.tdt`){ system (qq($BASEDIR/nbsstools/tdtgen/bin/tdtgen $TDT)); } } else { print "Skipping tdtgen file generation -- if you want to force a r +egen\n"; print "of tdt files, delete $BASEDIR/nbssoammsg/tdt/src/tdt9999.cx +x\n"; }
Another thing -- I don't think the second line is doing what you think it is. If you make a system call to cd, the shell that's spawned changes directories and exits -- your Perl program is in the same directory it was. You should use chdir() to change directories, like:
chdir("$BASEDIR/nbssoammsg/tdt/src") or error_code_here();
- Matt Riffle