my @morse = qw( .- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --.. ); my $text = "The eight letter secret token is $token ..."; $text = uc($text); $text =~ s{([A-Z])}{$morse[ord($1) - ord('A')] . ' '}ge; $text =~ s{[.]}{Dit}g; $text =~ s{[-]}{Dah}g;
- Converted to email format using MIME::Lite->as_string
- Manually added 'From' line to make an mbox file
- Tested with Evolution, vim & online Morse converters