Please post code with <code> tags. Then we can be sure that no elements vanish in the markup.
As it stands your example fails not only because res is undefined (could be a subroutine name) but because the qq... construct afterwards would produce syntac errors in its posted form.