2 IPC::MorseSignals - Communicate between processes with Morse signals.
8 use IPC::MorseSignals qw/msend mrecv/;
12 die "fork() failed: $!";
14 local @SIG{qw/USR1 USR2/} = mrecv sub { print STDERR "recieved $_[0]!\n" };
17 msend "hello!\n" => $pid;
21 This module implements a rare form of IPC by sending Morse-like signals
22 through "SIGUSR1" and "SIGUSR2". It uses both signals "SIGUSR1" and
23 "SIGUSR2", so you won't be able to keep them for something else when you
26 But, seriously, use something else for your IPC. :)
30 msend $msg, $pid [, $speed ]
32 Sends the string $msg to the process $pid (or to all the processes @$pid
33 if $pid is an array ref) at $speed bits per second. Default speed is
34 1000, don't set it too low or the target will miss bits and the whole
35 message will be crippled.
40 Takes as its sole argument the callback triggered when a complete
41 message is received, and returns two code references that should replace
42 SIGUSR1 and SIGUSR2 signal handlers. Basically, you want to use it like
45 local @SIG{qw/USR1 USR2/} = mrecv sub { ... };
48 This module exports on request its two only functions, "msend" and
52 POSIX (standard since perl 5) and Time::HiRes (standard since perl
56 perlipc for information about signals.
58 For truely useful IPC, search for shared memory, pipes and semaphores.
61 Vincent Pit, "<perl at profvince.com>"
63 You can contact me by mail or on #perl @ FreeNode (Prof_Vince).
66 Please report any bugs or feature requests to "bug-ipc-morsesignals at
67 rt.cpan.org", or through the web interface at
68 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IPC-MorseSignals>. I
69 will be notified, and then you'll automatically be notified of progress
70 on your bug as I make changes.
73 You can find documentation for this module with the perldoc command.
75 perldoc IPC::MorseSignals
78 Thanks for the inspiration, mofino ! I hope this module will fill all
82 Copyright 2007 Vincent Pit, all rights reserved.
84 This program is free software; you can redistribute it and/or modify it
85 under the same terms as Perl itself.