in reply to string translation
substr is an lvalue,
That trick can be used with s///, tr///, or any other mutator as well.my $N = 3; $_ = 'zebra'; # uppercase 1st $N substr($_, 0, $N) = uc substr $_, 0, $N; # lowercase last 3 substr($_, -3) = lc substr $_, -3; print;
After Compline,
Zaxo
|
|---|