]> git.vpit.fr Git - perl/modules/Bit-MorseSignals.git/blobdiff - lib/Bit/MorseSignals/Receiver.pm
Make sure the POD headings are linkable
[perl/modules/Bit-MorseSignals.git] / lib / Bit / MorseSignals / Receiver.pm
index 874bb9a072617357b19f9d51c3e1135fc522fc6e..1eb7befe980215f25a39526ba1335299e42c68ce 100644 (file)
@@ -3,11 +3,11 @@ package Bit::MorseSignals::Receiver;
 use strict;
 use warnings;
 
-use Carp qw/croak/;
-use Encode qw/decode_utf8/;
-use Storable qw/thaw/;
+use Carp     qw<croak>;
+use Encode   qw<decode_utf8>;
+use Storable qw<thaw>;
 
-use Bit::MorseSignals qw/:consts/;
+use Bit::MorseSignals qw<:consts>;
 
 =head1 NAME
 
@@ -15,11 +15,11 @@ Bit::MorseSignals::Receiver - Base class for Bit::MorseSignals receivers.
 
 =head1 VERSION
 
-Version 0.06
+Version 0.08
 
 =cut
 
-our $VERSION = '0.06';
+our $VERSION = '0.08';
 
 =head1 SYNOPSIS
 
@@ -46,7 +46,9 @@ sub _check_self {
 
 =head1 METHODS
 
-=head2 C<< new < done => $cb > >>
+=head2 C<new>
+
+    my $bmr = Bit::MorseSignals::Receiver->new(done => $cb);
 
 L<Bit::MorseSignals::Receiver> object constructor. With the C<'done'> option, you can specify a callback that will be triggered every time a message is completed, and in which C<$_[0]> will be the receiver object and C<$_[1]> the message received.
 
@@ -66,7 +68,9 @@ sub new {
  return $self;
 }
 
-=head2 C<push $bit>
+=head2 C<push>
+
+    $bmr->push($bit);
 
 Tells the receiver that you have received the bit C<$bit>. Returns true while the message isn't completed, and C<undef> as soon as it is.
 
@@ -117,7 +121,7 @@ sub push {
    my $type = 2 * vec($self->{buf}, 1, 1)
                 + vec($self->{buf}, 0, 1);
    $type = BM_DATA_PLAIN if vec($self->{buf}, 2, 1);
-   @{$self}{qw/state type buf len/} = (3, $type, '', 0);
+   @{$self}{qw<state type buf len>} = (3, $type, '', 0);
   }
 
  } elsif ($self->{state} == 1) { # end of signature
@@ -129,7 +133,7 @@ sub push {
 
  } else { # first bit
 
-  @{$self}{qw/state sig sig_bit sig_len buf len/}
+  @{$self}{qw<state sig sig_bit sig_len buf len>}
            = (1,    '', $bit,   1,      '', 0  );
   vec($self->{sig}, 0, 1) = $bit;
 
@@ -148,7 +152,7 @@ sub reset {
  my ($self) = @_;
  _check_self($self);
  $self->{state} = 0;
- @{$self}{qw/sig sig_bit sig_len type buf len/} = ();
+ @{$self}{qw<sig sig_bit sig_len type buf len>} = ();
  return $self;
 }