X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FIPC-MorseSignals.git;a=blobdiff_plain;f=samples%2Ftry.pl;fp=samples%2Ftry.pl;h=f76d7471f394ec6b63bc7b573e9c812198b8debb;hp=68388c8e02b4d938dac434822a7c061bfb29cdcb;hb=0b4f6d24128d9d60c3f8a5010e43bdfd9de7b655;hpb=20477798fb2d66f61ad45d4645f261b9fbdc7e4a diff --git a/samples/try.pl b/samples/try.pl index 68388c8..f76d747 100755 --- a/samples/try.pl +++ b/samples/try.pl @@ -15,10 +15,10 @@ if (!defined $pid) { die "fork() failed : $!"; } elsif ($pid == 0) { local %SIG; - my $rcv = new IPC::MorseSignals::Receiver \%SIG, done => sub { + my $rcv = IPC::MorseSignals::Receiver->new(\%SIG, done => sub { print STDERR "I, the child, recieved this : $_[1]\n"; exit EXIT_SUCCESS; - }; + }); print STDERR "I'm $$ (the child), and I'm waiting for data...\n"; pause while 1; exit EXIT_FAILURE; @@ -26,7 +26,7 @@ if (!defined $pid) { print STDERR "I'm $$ (the parent), and I'm gonna send a message to my child $pid.\n"; -my $snd = new IPC::MorseSignals::Emitter speed => 1000; +my $snd = IPC::MorseSignals::Emitter->new(speed => 1000); $snd->post("This message was sent with IPC::MorseSignals"); $snd->send($pid); waitpid $pid, 0;