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.17';
25 Due to the POSIX signals specification (which I wasn't aware of at the time I wrote this module), this module is by nature completely unreliable and will never work properly.
26 It is therefore B<deprecated>.
27 Please don't use it (if you were actually crazy enough to use it).
31 use IPC::MorseSignals::Receiver;
34 my $pants = IPC::MorseSignals::Receiver->new(\%SIG, done => sub {
35 print STDERR "GOT $_[1]\n";
40 This module installs C<< $SIG{qw<USR1 USR2>} >> handlers and forwards the bits received to an underlying L<Bit::MorseSignals> receiver.
46 my $imr = IPC::MorseSignals::Receiver->new(%bmr_options);
48 Creates a new receiver object.
49 Its arguments are passed to L<Bit::MorseSignals::Receiver/new>, in particular the C<done> callback.
56 $class = ref $class || $class || return;
57 croak 'The first argument must be a hash reference to the %SIG hash'
58 unless $sig and ref $sig eq 'HASH';
59 my $self = bless $class->SUPER::new(@_), $class;
60 @{$sig}{qw<USR1 USR2>} = (sub { $self->push(0) }, sub { $self->push(1) });
66 IPC::MorseSignals::Receiver objects also inherit methods from L<Bit::MorseSignals::Receiver>.
70 An object module shouldn't export any function, and so does this one.
74 L<Bit::MorseSignals::Receiver>.
76 L<Carp> (standard since perl 5) is also required.
80 L<IPC::MorseSignals>, L<IPC::MorseSignals::Emitter>.
82 L<Bit::MorseSignals>, L<Bit::MorseSignals::Emitter>, L<Bit::MorseSignals::Receiver>.
84 L<perlipc> for information about signals in perl.
86 For truly useful IPC, search for shared memory, pipes and semaphores.
90 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
92 You can contact me by mail or on C<irc.perl.org> (vincent).
96 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>.
97 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
101 You can find documentation for this module with the perldoc command.
103 perldoc IPC::MorseSignals::Receiver
105 =head1 COPYRIGHT & LICENSE
107 Copyright 2007,2008,2013,2017 Vincent Pit, all rights reserved.
109 This program is free software; you can redistribute it and/or modify it
110 under the same terms as Perl itself.
114 1; # End of IPC::MorseSignals::Receiver