+ 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.
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.
@@ -54,7+56,7 @@ L<Bit::MorseSignals::Receiver> object constructor. With the C<'done'> option, yo
sub new {
my $class = shift;
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 = {
croak 'Optional arguments must be passed as key => value pairs' if @_ % 2;