Convert::Morse

Convert::Morse is a package to convert between ASCII text and MORSE alphabet.
Download

Convert::Morse Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Convert::Morse Team
  • Publisher web site:
  • http://search.cpan.org/~tels/Convert-Morse-0.04/lib/Convert/Morse.pm

Convert::Morse Tags


Convert::Morse Description

Convert::Morse is a package to convert between ASCII text and MORSE alphabet. Convert::Morse is a package to convert between ASCII text and MORSE alphabet.SYNOPSIS use Convert::Morse qw(as_ascii as_morse is_morsable); print as_ascii('.... . .-.. .-.. --- -- --- .-. ... .'),"n"; # 'Helo Morse' print as_morse('Perl?'),"n"; # '.--. . .-. .-.. ..--..' print "Yes!n" if is_morsable('Helo Perl.'); # print "Yes!"This module lets you convert between normal ASCII text and international Morse code. You can redefine the token sets, if you like.INPUTASCII text can have both lower and upper case, it will be converted to upper case prior to converting.Morse code input consists of dashes '-' and dots '.'. The elements MUST NOT to have spaces between, e.g. A is '.-' and not '. -'. Characters MUST have at least one space between. Additonal spaces are left over to indicate word boundaries. This means '.- -...' means 'AB' and and '.- -...' means 'A B'.The conversion routines are designed to be stable and ignore/skip unknown input, so that you can write: print as_ascii('Hello -- --- .-. ... . Perl!');beware, though, a single '.' or '-' at the end will be interpreted as '. ' respective '- ' and thus become 'E' or 'T'. Use Convert::Morse::error() to check wether all went ok or not.OUTPUTThe output will always consist of upper case letters or, in case of as_morse(), of .ERRORSUnknown tokens in the input are ignored/skipped. In these cases you get the last error message with Convert::Morse::error().Limitations:· Can not yet do Japanese code nor German Umlaute. Requirements: · Perl · Exporter


Convert::Morse Related Software