http://www.perlmonks.org?node_id=1077372


in reply to checking particular part of string

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;'

Replies are listed 'Best First'.
Re^2: checking particular part of string
by moritz (Cardinal) on Mar 07, 2014 at 12:17 UTC