foreach loop

Hi everyone
Does anyone know what is wrong with this script. i keep getting errors
foreach filename (`cat testing1`)
set string=$filename
set depth=`echo "$string"
echo $depth
end

the error is the following
testing: line 1: syntax error near unexpected token `('
testing: line 1: `foreach filename (`cat testing1`)'

I would appreciate it

ok guys now it works but it only does the echo command once and displaying the first line, can you guys tell me why this doesn't happen for all of the input line of the file testing1

set depth=`echo "$string" 

It looks like you are missing a `
Personally, I like setting a variable such like

depth=$(echo "$string")

The command is now inside ( ) and less chance of missing a special character.

thx for the response but i figured out the problem. the file was saved not including "END" at the end of the file(by not pressing ENTER after typing end).
that was the only problem but a hard one for me to capture.