use HTML::Entities; my($text) = "Kren’s 89th birthday"; print encode_entities($text), $/;