$dirtoget="/home/com/begp/testinvs"; opendir(TIDIR, $dirtoget) || die("Cannot open directory"); @thefiles=readdir(TIDIR); #closedir(TIDIR); foreach $f (@thefiles) { unless ( ($f eq ".") || ($f eq "..") ) { `perl /home/com/begp/test_script.pl` $f || die "Error!"; #This line seems to be giving me errors...I'm not sure my syntax is correct here. } }