1 package IPC::MorseSignals::Receiver;
8 use Bit::MorseSignals::Receiver;
9 use base qw/Bit::MorseSignals::Receiver/;
13 IPC::MorseSignals::Receiver - Base class for IPC::MorseSignals receivers.
21 our $VERSION = '0.16';
25 use IPC::MorseSignals::Receiver;
28 my $pants = IPC::MorseSignals::Receiver->new(\%SIG, done => sub {
29 print STDERR "GOT $_[1]\n";
34 This module installs C<$SIG{qw/USR1 USR2/}> handlers and forwards the bits received to an underlying L<Bit::MorseSignals> receiver.
40 my $imr = IPC::MorseSignals::Receiver->new(%bmr_options);
42 Creates a new receiver object.
43 Its arguments are passed to L<Bit::MorseSignals::Receiver/new>, in particular the C<done> callback.
50 $class = ref $class || $class || return;
51 croak 'The first argument must be a hash reference to the %SIG hash'
52 unless $sig and ref $sig eq 'HASH';
53 my $self = bless $class->SUPER::new(@_), $class;
54 @{$sig}{qw/USR1 USR2/} = (sub { $self->push(0) }, sub { $self->push(1) });
60 IPC::MorseSignals::Receiver objects also inherit methods from L<Bit::MorseSignals::Receiver>.
64 An object module shouldn't export any function, and so does this one.
68 L<Bit::MorseSignals::Receiver>.
70 L<Carp> (standard since perl 5) is also required.
74 L<IPC::MorseSignals>, L<IPC::MorseSignals::Emitter>.
76 L<Bit::MorseSignals>, L<Bit::MorseSignals::Emitter>, L<Bit::MorseSignals::Receiver>.
78 L<perlipc> for information about signals in perl.
80 For truly useful IPC, search for shared memory, pipes and semaphores.
84 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
86 You can contact me by mail or on C<irc.perl.org> (vincent).
90 Please report any bugs or feature requests to C<bug-ipc-morsesignals-receiver at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IPC-MorseSignals>.
91 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
95 You can find documentation for this module with the perldoc command.
97 perldoc IPC::MorseSignals::Receiver
99 =head1 COPYRIGHT & LICENSE
101 Copyright 2007,2008,2013 Vincent Pit, all rights reserved.
103 This program is free software; you can redistribute it and/or modify it
104 under the same terms as Perl itself.
108 1; # End of IPC::MorseSignals::Receiver