Hacker News new | ask | show | jobs
by forinti 20 days ago
This reminds me of a T-shirt I once saw that read:

          perl -e '
     "$a="etbjxntqrdke";
  $a=~s/(.)/chr(ord($1)+1)/eg;
        print "$a\n;"'
It's cursing. Don't run it if it might offend you.

Upon seeing this, I decided to golf and came up with a shorter version:

  perl -e "print chr 1+ ord for split //,'etbjxntqrdke'"
1 comments

or

  raku -e 'say "etbjxntqrdke".comb.map({chr .ord + 1}).join'
or

raku -e 'say "etbjxntqrdke".comb.map(*.succ).join'

This is just a ROT1, so perl -pe'y/a-z/b-za/'<<<etbjxntqrdke
That makes for a cool rot13: /a-z/n-za-m/
raku -pe 'tr/a..z/b..za/' <<< etbjxntqrdke