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


in reply to Terms shortener :-)

For pre-5.20 perls, one needs -alpe , as a ins't implied by F .

I'd also try

perl -pe 's/.\K(.*)(?=.)/length$1/e'
(needs 5.10).

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,