in reply to Re: A little golfing challenge: replace digits by random letters (updated) -- oneliner
in thread A little golfing challenge: replace digits by random letters

That's already impressive, but why bother with chr in the first place? perl '-M0;@h{+a..z}=1'-pe 's/\d/(keys%h)[$&]/eg' input.txt works just as fine.

Edit: this can still be reduced a little:

perl '-M0;@h{a..z}=1'-pe 's/\d/(%h)[$&*2]/eg' input.txt

  • Comment on Re^2: A little golfing challenge: replace digits by random letters (updated) -- oneliner
  • Select or Download Code