5 minutes after such a liability law was passed, I would decide never to post code publically to places like PerlMonks, and not to post code to places like CPAN.
Even if I was perfectly sure that I wrote code with no mistakes, there is no way I want to have to prove that in a court that is hard for me to get to because some idiot in South Dakota refused to understand that the bug is in their code, not mine. And, of course, I am not perfectly sure. Reasonably sure? Yes. But if you are writing software for monitoring hearts, and you use code I gave away for fun, then should be your responsibility to validate that the code is sufficient to your needs before you use it.
I think you will find that, no matter how you cut it, this is a thorny issue.