#!/usr/bin/perl
%hash = ();
$hash{"a"} = "AA";
$hash{"h"} = "AD";
$hash{"t"} = "DF";
$hash{"r"} = "XG";
$hash{"s"} = "XF";
$hash{"l"} = "FG";
$hash{"n"} = "AG";
$hash{"e"} = "GA";

$message = "last trane has a hat";
$message =~ s/\s+//g;

foreach $key (keys %hash) {
	print "Our current key is $key\n";
	
	$message =~ s/$key/$hash{$key}/g;
	print "\t The message is now $message\n";
}
