$find = 's'; $replace = 'X'; $string = 'Snakes'; $string =~ s/$find$/$replace/; print $string, "\n";
In reply to Re: Replace the last letter
by mifflin
in thread Replace the last letter
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |