]> git.vpit.fr Git - perl/modules/Bit-MorseSignals.git/blobdiff - lib/Bit/MorseSignals/Emitter.pm
This is 0.08
[perl/modules/Bit-MorseSignals.git] / lib / Bit / MorseSignals / Emitter.pm
index 441e6e4cc5dd5702f3f4aa4d34c3d5589244578a..a384d148a6c48c36e65c93b9254cc57b2a9ae63e 100644 (file)
@@ -3,11 +3,11 @@ package Bit::MorseSignals::Emitter;
 use strict;
 use warnings;
 
-use Carp qw/croak/;
-use Encode qw/encode_utf8 is_utf8/;
-use Storable qw/freeze/;
+use Carp     qw<croak>;
+use Encode   qw<encode_utf8 is_utf8>;
+use Storable qw<freeze>;
 
-use Bit::MorseSignals qw/:consts/;
+use Bit::MorseSignals qw<:consts>;
 
 =head1 NAME
 
@@ -15,17 +15,17 @@ Bit::MorseSignals::Emitter - Base class for Bit::MorseSignals emitters.
 
 =head1 VERSION
 
-Version 0.05
+Version 0.08
 
 =cut
 
-our $VERSION = '0.05';
+our $VERSION = '0.08';
 
 =head1 SYNOPSIS
 
     use Bit::MorseSignals::Emitter;
 
-    my $deuce = new Bit::MorseSignals::Emitter;
+    my $deuce = Bit::MorseSignals::Emitter->new;
     $deuce->post("hlagh") for 1 .. 3;
     while (defined(my $bit = $deuce->pop)) {
      sends_by_some_mean_lets_say_signals($bit);
@@ -70,7 +70,7 @@ L<Bit::MorseSignals::Emitter> object constructor. Currently does not take any op
 
 sub new {
  my $class = shift;
$class = ref $class || $class || return;
return unless $class = ref $class || $class;
  croak 'Optional arguments must be passed as key => value pairs' if @_ % 2;
  my %opts = @_;
  my $self = {
@@ -102,7 +102,7 @@ sub post {
   #      BM_DATA_{PLAIN,         UTF8,          STORABLE}
   $type = BM_DATA_AUTO unless defined $type and exists $manglers[$type];
   if (ref $msg) {
-   return if { map { $_ => 1 } qw/CODE GLOB/ }->{ref $msg};
+   return if { map { $_ => 1 } qw<CODE GLOB> }->{ref $msg};
    $type = BM_DATA_STORABLE;
   } elsif ($type == BM_DATA_AUTO) {
    $type = is_utf8($msg) ? BM_DATA_UTF8 : BM_DATA_PLAIN;
@@ -128,8 +128,8 @@ sub post {
  $self->{state} = 2;
 
  my $head = '';
- vec($head, 0, 1) = ($type & 2) >> 1;
- vec($head, 1, 1) = ($type & 1);
+ vec($head, 0, 1) = ($type & 1);
+ vec($head, 1, 1) = ($type & 2) >> 1;
  vec($head, 2, 1) = 0;
  my $hlen = 3;
 
@@ -210,7 +210,7 @@ sub reset {
  my ($self) = @_;
  _check_self($self);
  $self->{state} = @{$self->{queue}} > 0;
- @{$self}{qw/buf len pos/} = ();
+ @{$self}{qw<buf len pos>} = ();
  return $self;
 }
 
@@ -267,7 +267,7 @@ L<Bit::MorseSignals>, L<Bit::MorseSignals::Receiver>.
 
 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
 
-You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).
+You can contact me by mail or on C<irc.perl.org> (vincent).
 
 =head1 BUGS
 
@@ -279,6 +279,8 @@ You can find documentation for this module with the perldoc command.
 
     perldoc Bit::MorseSignals::Emitter
 
+Tests code coverage report is available at L<http://www.profvince.com/perl/cover/Bit-MorseSignals>.
+
 =head1 COPYRIGHT & LICENSE
 
 Copyright 2008 Vincent Pit, all rights reserved.