#!/usr/local/bin/perl # Baconian Caesar Cipher +4 (A becomes E, B becomes F, etc.) while (<>) { $_=~ s/0XxZz//g; $_=~ tr/jJuUwW123456789/iIvVvVABCDEFGHI/; $_=~ tr/ABCDEFGHIKLMNOPQRSTVYabcdefghiklmnopqrstvy/EFGHIKLMNOPQRSTVYABCDefghiklmnopqrstvyabcd/; print $_; } # The rest of this file is comments and may be deleted. # Save this script as a file called "bplus4.pl" # To set file permission so that you may run bplus4.pl, enter this # command: # chmod u+x bplus4.pl # To use this script, enter this command: # bplus4.pl infile > outfile # If the script does not run, check to make sure that perl is located in # your server's "/usr/local/bin/" directory. If perl is located # elsewhere, change the first line of this script so that it points to # the right location # This script translates any file into a 21-letter alphabet and then # shifts each letter to the one four places later in alphabetical order, # in accordance with the rules Penn Leary believes Francis Bacon used: # This script first deletes X's, Y's, and 0's. # It then changes J's to I's, U's and W's to V's, and the numerals from 1 # to 9 into the letters from A to H (this script does not affect # capitalization or punctuation). # It now shifts each character (A becomes E, B beccomes F, etc.) # The infile should be the name of the file you want to work the cipher # on and the outfile should be a different file where you want to # redirect the output to. Don't use the infile as the outfile or it will # remove your original file. :-( # If you do not specify an outfile, then the script will print the contents # to the screen. # This script has no error checking.