#!/usr/bin/perl # caesar.pl # usage, to shift the phrase "THE SECRET WORD IS PASTA" by 13: # echo "THE SECRET WORD IS PASTA" | caesar.pl 13 $key = $ARGV[0]; $plaintext = ; $plaintext =~ s/\s+//g; @chars = split('',$plaintext); for $c (@chars) { print chr((ord($c)-ord("A")+$key)%26+ord("A")); } print "\n";