#!/usr/bin/perl open DATA,$ARGV[0]if$ARGV[0];$ ,=65;@ .=map$_,reverse chr$ ,..pack'c',$ .;$.=$, +25;print join'',map{join'',map{$ *=ord>ord uc z?push(@%,/./)&&uc:push(@%,0)&&$ _;$ ^=$ *=~/[chr$,-chr$.]/?$.[(ord$*)-$,]:$*;$%[$;++]?lc$^:$^}split q,,,} __DATA__ This is an implementation of an atbash (or 'zgyzhs') cipher, which encodes strings by replacing 'a' with 'z', 'b' with 'y', etc. This is my test string. This string includes CAPital letters, spaces, punctuation, and newlines. This tests EVERY capability of this implementation.