in reply to Massaging the Dictionary

You've got your substitute in single quotes! Try $result =~ s,\n$,<br />,gsm. However, \n$ looks highly suspicious. I don't think that's what you want.