If I understand your question...
substr($my_string, -1, 1) = "'\"";
In reply to Re: Formatting quotes in a String by perldigious in thread Formatting quotes in a String by pavan474