You might also want to look a a templating system like Template Toolkit or Mason. Not only do not have to worry about escaping your quotes, but you move your HTML out of your code. If you have ever tried to debug inline HTML in your perl code you'll understand why that is so great.
grep