=cut
-use base qw/Exporter/;
+use base qw<Exporter>;
our @EXPORT = ();
our %EXPORT_TAGS = (
- 'consts' => [ qw/BM_DATA_AUTO BM_DATA_PLAIN BM_DATA_UTF8 BM_DATA_STORABLE/ ]
+ 'consts' => [ qw<BM_DATA_AUTO BM_DATA_PLAIN BM_DATA_UTF8 BM_DATA_STORABLE> ]
);
our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
$EXPORT_TAGS{'all'} = [ @EXPORT_OK ];
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
# 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;
my ($self) = @_;
_check_self($self);
$self->{state} = @{$self->{queue}} > 0;
- @{$self}{qw/buf len pos/} = ();
+ @{$self}{qw<buf len pos>} = ();
return $self;
}
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
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
} 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;
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;
}
require Bit::MorseSignals;
-for (qw/BM_DATA_AUTO BM_DATA_PLAIN BM_DATA_UTF8 BM_DATA_STORABLE/) {
+for (qw<BM_DATA_AUTO BM_DATA_PLAIN BM_DATA_UTF8 BM_DATA_STORABLE>) {
eval { Bit::MorseSignals->import($_) };
ok(!$@, 'import ' . $_);
}
require Bit::MorseSignals::Emitter;
-for (qw/new post pop len pos reset flush busy queued/) {
+for (qw<new post pop len pos reset flush busy queued>) {
ok(Bit::MorseSignals::Emitter->can($_), 'BME can ' . $_);
}
require Bit::MorseSignals::Receiver;
-for (qw/new push reset busy msg/) {
+for (qw<new push reset busy msg>) {
ok(Bit::MorseSignals::Receiver->can($_), 'BMR can ' . $_);
}
is(ref $deuce2, 'Bit::MorseSignals::Emitter', 'BME::new called as an object method works is valid');
ok(!defined Bit::MorseSignals::Emitter::new(), 'BME::new called without a class is invalid');
-eval { $deuce2 = Bit::MorseSignals::Emitter->new(qw/a b c/) };
+eval { $deuce2 = Bit::MorseSignals::Emitter->new(qw<a b c>) };
like($@, qr/Optional\s+arguments/, 'BME::new gets parameters as key => value pairs');
my $fake = { };
bless $fake, 'Bit::MorseSignal::Hlagh';
-for (qw/post pop len pos reset flush busy queued/) {
+for (qw<post pop len pos reset flush busy queued>) {
eval "Bit::MorseSignals::Emitter::$_('Bit::MorseSignals::Emitter')";
like($@, qr/^First\s+argument/, "BME::$_ isn't a class method");
eval "Bit::MorseSignals::Emitter::$_(\$fake)";
like($@, qr/^First\s+argument/, "BME::$_ only applies to BME objects");
}
-eval { $deuce->post('foo', qw/a b c/) };
+eval { $deuce->post('foo', qw<a b c>) };
like($@, qr/Optional\s+arguments/, 'BME::post gets parameters after the first as key => value pairs');
ok(!defined($deuce->post(sub { 1 })), 'BME::post doesn\'t take CODE references');
ok(!defined($deuce->post(\*STDERR)), 'BME::post doesn\'t take GLOB references');
use Test::More 'no_plan';
-use Bit::MorseSignals qw/BM_DATA_PLAIN/;
+use Bit::MorseSignals qw<BM_DATA_PLAIN>;
use Bit::MorseSignals::Emitter;
my $deuce = Bit::MorseSignals::Emitter->new(utf8 => 'DO WANT');
is(ref $pants2, 'Bit::MorseSignals::Receiver', 'BMR::new called as an object method works is valid');
ok(!defined Bit::MorseSignals::Receiver::new(), 'BMR::new called without a class is invalid');
-eval { $pants2 = Bit::MorseSignals::Receiver->new(qw/a b c/) };
+eval { $pants2 = Bit::MorseSignals::Receiver->new(qw<a b c>) };
like($@, qr/Optional\s+arguments/, 'BME::new gets parameters as key => value pairs');
my $fake = { };
bless $fake, 'Bit::MorseSignal::Hlagh';
-for (qw/push reset busy msg/) {
+for (qw<push reset busy msg>) {
eval "Bit::MorseSignals::Receiver::$_('Bit::MorseSignals::Receiver')";
like($@, qr/^First\s+argument/, "BMR::$_ isn't a class method");
eval "Bit::MorseSignals::Receiver::$_(\$fake)";
use Bit::MorseSignals::Emitter;
use Bit::MorseSignals::Receiver;
-my @msgs = qw/hlagh hlaghlaghlagh HLAGH HLAGHLAGHLAGH \x{0dd0}\x{00}
- h\x{00}la\x{00}gh \x{00}\x{ff}\x{ff}\x{00}\x{00}\x{ff}/;
+my @msgs = qw<hlagh hlaghlaghlagh HLAGH HLAGHLAGHLAGH \x{0dd0}\x{00}
+ h\x{00}la\x{00}gh \x{00}\x{ff}\x{ff}\x{00}\x{00}\x{ff}>;
my $deuce = Bit::MorseSignals::Emitter->new;
my $pants = Bit::MorseSignals::Receiver->new(done => sub {
use Bit::MorseSignals::Emitter;
use Bit::MorseSignals::Receiver;
-my @msgs = qw/€éèë 月語 x tata たTÂ/;
+my @msgs = qw<€éèë 月語 x tata たTÂ>;
sub cp { join '.', map ord, split //, $_[0] }