in reply to text cut at blanks

Is it really or are you looking at what the displayed html is giving you? You probably just forgot the quotes there. The following
<INPUT Name='anyname' VALUE=abc def>

is creating a new tag def and setting VALUE to abc only

print "<INPUT Name=\"anyname\" VALUE=\"$v\">";

should fix it.

--
A much wittier reply came to mind immediately after I clicked the "Submit" button.