Of cause you can. Why shouldn't you be able to use a local variable? I didn't find anything that tells not to do this in the manual and it even compiles and runs like a charme...
Always learn from history, to be sure you make the same mistakes again...