Welcome to the Monastery | |
PerlMonks |
Re: checking particular part of stringby hippo (Bishop) |
on Mar 07, 2014 at 12:12 UTC ( [id://1077372]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|