in reply to html form not working

As shmem said you need to have a look at what $joined contains. You may dump it somewhere in generated HTML by using something like:

use CGI 'escapeHTML'; # needs to import &escapeHTML somewhere print <<HTML; <pre> @{[escapeHTML($joined)]} </pre> HTML

The CGI function escapeHTML will escape special HTML characters (like < and >) and pre tag will outline them.

You may want to use the same trick @{[escapeHTML($joined)]} to interpolate safely escaped variables in the generated page.