in reply to Re^2: Replace the last letter
in thread Replace the last letter

If you always want the last letter, you could match:

$string =~ s/.$/X/; ## or $letter = 'X'; $string =~ s/.$/$letter/;
As opposed to the substr use.

radiantmatrix
require General::Disclaimer;