in reply to Warnings, strict HTML scalar

Yes, you should fix warnings, unless you absolutely know what you're doing, and why the warning doesn't apply. Which doesn't appear to be the case here.

From the error, it seems to me that the variables $error_msg_x, $error_msg_xx etc are undefined.

If you want them empty, but also want to avoid the warning, initialize them to "" (the empty string).