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.12';
25 use IPC::MorseSignals::Receiver;
28 my $pants = new IPC::MorseSignals::Receiver \%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 Creates a new receiver object. Its arguments are passed to L<Bit::MorseSignals::Receiver/new>, in particular the C<done> callback.
47 $class = ref $class || $class || return;
48 croak 'The first argument must be a hash reference to the %SIG hash'
49 unless $sig and ref $sig eq 'HASH';
50 my $self = bless $class->SUPER::new(@_), $class;
51 @{$sig}{qw/USR1 USR2/} = (sub { $self->push(0) }, sub { $self->push(1) });
57 IPC::MorseSignals::Receiver objects also inherit methods from L<Bit::MorseSignals::Receiver>.
61 An object module shouldn't export any function, and so does this one.
65 L<Bit::MorseSignals::Receiver>.
67 L<Carp> (standard since perl 5) is also required.
71 L<IPC::MorseSignals>, L<IPC::MorseSignals::Emitter>.
73 L<Bit::MorseSignals>, L<Bit::MorseSignals::Emitter>, L<Bit::MorseSignals::Receiver>.
75 L<perlipc> for information about signals in perl.
77 For truly useful IPC, search for shared memory, pipes and semaphores.
81 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
83 You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).
87 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>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
91 You can find documentation for this module with the perldoc command.
93 perldoc IPC::MorseSignals::Receiver
95 =head1 COPYRIGHT & LICENSE
97 Copyright 2007-2008 Vincent Pit, all rights reserved.
99 This program is free software; you can redistribute it and/or modify it
100 under the same terms as Perl itself.
104 1; # End of IPC::MorseSignals::Receiver