GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CONVERT::MORSE (3)

.ds Aq ’

NAME

Convert::Morse - Convert between ASCII text and MORSE alphabet

CONTENTS

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!"



REQUIRES

perl5.8.1, Exporter

EXPORTS

Exports nothing on default, but can export as_ascii() and as_morse().

DESCRIPTION

This module lets you convert between normal ASCII text and international Morse code. You can redefine the token sets, if you like.

    INPUT

ASCII 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 <B>MUST NOTB> to have spaces between, e.g. A is .- and not . -. Characters <B>MUSTB> 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.

    OUTPUT

The output will always consist of upper case letters or, in case of as_morse(), of [-. ].

    ERRORS

Unknown tokens in the input are ignored/skipped. In these cases you get the last error message with Convert::Morse::error().

METHODS

BIas_ascii()



            as_ascii();



Convert a Morse code text consisting of dashes and dots to ASCII.

BIas_morse()



            as_morse();



Convert a ASCII text to Morse code text consisting of dashes, dots and spaces.

BIis_morse()



            is_morse();



Return wether input is a true Morse code string or not.

BIis_morsable()



            is_morseable();



Return wether input can be completely expressed as Morse code or not.

BItokens()



        Convert::Morse::tokens( { a => ..-...-..--.. } );



Set/get the hash of the valid and invalid tokens that are used in the conversion between ASCII and Morse.

The format is ascii => morse.

BIerror()



            error();



Returns the last error message or undef when no error occured.

LIMITATIONS

Can not yet do Japanese code nor German Umlaute.

LICENSE

This library is free software; you can redistribute it and/or modify it under the terms of the GPL 2.0 or a later version.

See the LICENSE file for a copy of the GPL.

AUTHOR

Tels http://bloodgate.com in late 2000, 2004, 2007, 2008.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CONVERT::MORSE (3) 2008-02-26

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.