14 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
15 |
|
|
16 |
use Exporter 'import'; |
use Exporter 'import'; |
17 |
our @EXPORT = qw'$white $black'; |
our @EXPORT = qw'$white $black @flip'; |
18 |
|
|
19 |
use base qw(Class::Accessor Prefs); |
use base qw(Class::Accessor Prefs); |
20 |
__PACKAGE__->mk_accessors(qw(app event)); |
__PACKAGE__->mk_accessors(qw(app event)); |
326 |
} |
} |
327 |
} |
} |
328 |
|
|
329 |
|
# helper array to flip bytes for display |
330 |
|
our @flip; |
331 |
|
|
332 |
|
foreach my $i ( 0 .. 255 ) { |
333 |
|
my $t = 0; |
334 |
|
$i & 0b00000001 and $t = $t | 0b10000000; |
335 |
|
$i & 0b00000010 and $t = $t | 0b01000000; |
336 |
|
$i & 0b00000100 and $t = $t | 0b00100000; |
337 |
|
$i & 0b00001000 and $t = $t | 0b00010000; |
338 |
|
$i & 0b00010000 and $t = $t | 0b00001000; |
339 |
|
$i & 0b00100000 and $t = $t | 0b00000100; |
340 |
|
$i & 0b01000000 and $t = $t | 0b00000010; |
341 |
|
$i & 0b10000000 and $t = $t | 0b00000001; |
342 |
|
#warn "$i = $t\n"; |
343 |
|
$flip[$i] = $t; |
344 |
|
} |
345 |
|
|
346 |
=head1 SEE ALSO |
=head1 SEE ALSO |
347 |
|
|
348 |
L<Orao> is sample implementation using this module |
L<Orao> is sample implementation using this module |