#!/usr/bin/perl # transliterate.pl use strict; use warnings; print "Please enter your message to be encrypted.\n"; my $message = ; chomp($message); # generate randomized alphabet my @chars = ("A".."Z", "a".."z"); my $string; $string .= $chars[rand @chars] for 1..26; # I want to drop the random alphabet in $string into the replace-with slot of tr// my $code = eval($message =~ tr/abcdefghijklmnopqrstuvwxyz/$string/); print "Here is your encrypted message: $code\n"; # As is, $code returns the number of letters in the message.