]> git.vpit.fr Git - perl/modules/IPC-MorseSignals.git/blobdiff - samples/try.pl
Get rid of the indirect notation
[perl/modules/IPC-MorseSignals.git] / samples / try.pl
index 68388c8e02b4d938dac434822a7c061bfb29cdcb..f76d7471f394ec6b63bc7b573e9c812198b8debb 100755 (executable)
@@ -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;