Win32 doesn't do signals (much), but has several more powerful alternatives. Take a look at Win32::IPC, Win32::Semaphore, Win32::Event, Win32::Mutex etc.

Here's one way of achieving your requirement.

#! perl -slw use strict; use Win32::Event; my $eventName = "MyEvent.$$"; print $eventName; my $event = new Win32::Event( 0, 0, $eventName ); my $timeout = rand 60000; print "Spawning a background script to wake me up in ", $timeout / 100 +0, " seconds"; ( my $cmd = <<EOP ) =~ s[\s+][ ]g; perl -MWin32::Event -wle" Win32::Sleep shift; print 'Waking them'; \$e=Win32::Event->open(shift) and \$e->set or die \$^E " $timeout $eventName EOP system 1, $cmd; $timeout /= 1000; my $rv = 0; print "Event should occur in ", int( --$timeout ) until $rv = $event- +>wait( 1000 ); print $rv ? 'Woken' : 'Event abandoned'; __END__ [20:54:53.64] P:\test>412941 MyEvent.648 Spawning a background script to wake me up in 17.080078125 seconds Event should occur in 16 Event should occur in 15 Event should occur in 14 Event should occur in 13 Event should occur in 12 Event should occur in 11 Event should occur in 10 Event should occur in 9 Event should occur in 8 Event should occur in 7 Event should occur in 6 Event should occur in 5 Event should occur in 4 Event should occur in 3 Event should occur in 2 Event should occur in 1 Event should occur in 0 Waking them Woken

Examine what is said, not who speaks.
"But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
"Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

In reply to Re: how to implement interprocess communication by BrowserUk
in thread how to implement interprocess communication by redss

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.