in reply to concatening strings
I'm not sure exactly what you're wanting, and your code is somewhat unformatted and difficult to follow. There are probably better ways, but the following should get you started:
my (@elements) = split(/\s/, $_);
my $html = "<td><input type=\"$elements\" name=\"$elements\"
Subject checkbox yes
Data checkbox yes
Update: asarih beat me to it. With a better solution too, imo.
If things get any worse, I'll have to ask you to stop helping me.