X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FIPC-MorseSignals.git;a=blobdiff_plain;f=lib%2FIPC%2FMorseSignals%2FReceiver.pm;h=e5d1a150107fa6b37059de39eb34ce6ca94d8055;hp=4ca5c1099889c6b8795472600a5ebf201499933c;hb=c6671a5ed11b430ee6fd63c40102d9981a75b3a4;hpb=ddcc7c395d570f0ea20a8e9a242fcbfcc0e49522 diff --git a/lib/IPC/MorseSignals/Receiver.pm b/lib/IPC/MorseSignals/Receiver.pm index 4ca5c10..e5d1a15 100644 --- a/lib/IPC/MorseSignals/Receiver.pm +++ b/lib/IPC/MorseSignals/Receiver.pm @@ -3,10 +3,10 @@ package IPC::MorseSignals::Receiver; use strict; use warnings; -use Carp qw/croak/; +use Carp qw; use Bit::MorseSignals::Receiver; -use base qw/Bit::MorseSignals::Receiver/; +use base qw; =head1 NAME @@ -14,30 +14,39 @@ IPC::MorseSignals::Receiver - Base class for IPC::MorseSignals receivers. =head1 VERSION -Version 0.10 +Version 0.17 =cut -our $VERSION = '0.10'; +our $VERSION = '0.17'; + +=head1 WARNING + +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. +It is therefore B. +Please don't use it (if you were actually crazy enough to use it). =head1 SYNOPSIS use IPC::MorseSignals::Receiver; local %SIG; - my $pants = new IPC::MorseSignals::Receiver \%SIG, done => sub { + my $pants = IPC::MorseSignals::Receiver->new(\%SIG, done => sub { print STDERR "GOT $_[1]\n"; - }; + }); =head1 DESCRIPTION -This module installs C<$SIG{qw/USR1 USR2/}> handlers and forwards the bits received to a L receiver. +This module installs C<< $SIG{qw} >> handlers and forwards the bits received to an underlying L receiver. =head1 METHODS =head2 C -Creates a new receiver object. Its arguments are passed to L, in particular the C callback. + my $imr = IPC::MorseSignals::Receiver->new(%bmr_options); + +Creates a new receiver object. +Its arguments are passed to L, in particular the C callback. =cut @@ -48,7 +57,7 @@ sub new { croak 'The first argument must be a hash reference to the %SIG hash' unless $sig and ref $sig eq 'HASH'; my $self = bless $class->SUPER::new(@_), $class; - @{$sig}{qw/USR1 USR2/} = (sub { $self->push(0) }, sub { $self->push(1) }); + @{$sig}{qw} = (sub { $self->push(0) }, sub { $self->push(1) }); return $self; } @@ -80,11 +89,12 @@ For truly useful IPC, search for shared memory, pipes and semaphores. Vincent Pit, C<< >>, L. -You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince). +You can contact me by mail or on C (vincent). =head1 BUGS -Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. +Please report any bugs or feature requests to C, or through the web interface at L. +I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT @@ -94,7 +104,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2007-2008 Vincent Pit, all rights reserved. +Copyright 2007,2008,2013,2017 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.