To make it generic you would need a capture group. eg:
echo sumanna | perl -pe 's/(na$)/uc($1)/e;'Is this what you were after?
Update: for an example with more obvious genericism try:
echo sumanna | perl -pe 's/(..$)/uc($1)/e;'In reply to Re: checking particular part of string
by hippo
in thread checking particular part of string
by sumandas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |