Bit-MorseSignals

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


        a ... a b | t0 t1 r | ... data ... | b a ... a
        signature | header  |     data     | reversed signature

    The receiver knows that the signature has been sent when it has catched
    at least one 0 and one 1. The signal is completely transferred when it
    has received for the first time the whole reversed signature.

CONSTANTS
  "BM_DATA_AUTO"
    Default for non-references messages. Try to guess if the given scalar is
    an UTF-8 string with "Encode::is_utf8".

  "BM_DATA_PLAIN"
    Treats the data as a plain string. No extra mangling in done.

  "BM_DATA_UTF8"
    Treats the data as an UTF-8 string. The string is
    "Encode::encode_utf8"'d in a binary string before sending, and
    "Encode::decode_utf8"'d by the receiver.

lib/Bit/MorseSignals.pm  view on Meta::CPAN


use constant {
 BM_DATA_AUTO     => -1,
 BM_DATA_PLAIN    => 0,
 BM_DATA_UTF8     => 1,
 BM_DATA_STORABLE => 2,
};

=head2 C<BM_DATA_AUTO>

Default for non-references messages. Try to guess if the given scalar is an UTF-8 string with C<Encode::is_utf8>.

=head2 C<BM_DATA_PLAIN>

Treats the data as a plain string. No extra mangling in done.

=head2 C<BM_DATA_UTF8>

Treats the data as an UTF-8 string. The string is C<Encode::encode_utf8>'d in a binary string before sending, and C<Encode::decode_utf8>'d by the receiver.

=head2 C<BM_DATA_STORABLE>



( run in 1.015 second using v1.01-cache-2.11-cpan-748bfb374f4 )