From 39f2c4429dd46dc12d167ea43126f0d63156bb25 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Sat, 2 Feb 2008 01:24:36 -0500 Subject: add another example script --- bin/cryptogram.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 bin/cryptogram.pl (limited to 'bin') diff --git a/bin/cryptogram.pl b/bin/cryptogram.pl new file mode 100644 index 0000000..d81c15e --- /dev/null +++ b/bin/cryptogram.pl @@ -0,0 +1,12 @@ +#!/usr/bin/perl +use strict; +use warnings; +use Games::Word qw/random_permutation/; + +my $alphabet = 'abcdefghijklmnopqrstuvwxyz'; +my $key = random_permutation $alphabet; +print "KEY: $key\n"; +print "MESSAGE:\n"; +my $text = join ' ', @ARGV; +eval "\$text =~ tr/$alphabet/$key/"; +print $text, "\n"; -- cgit v1.2.3-54-g00ecf