Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

alarm function

by mantra2006 (Hermit)
on Sep 25, 2006 at 17:15 UTC ( #574797=perlquestion: print w/replies, xml ) Need Help??
mantra2006 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks

I am working on a script which was written way back in 1997.
The script looks for a file and signals alarm that file has arrived
in a specific time or file hasn't arrived in that time...
on unix machines the alarm function is working where
as in Win32 systems the alarm function is working
ActiveState listed in its unimpleneted list of activities...
alarm($endsecs); local $SIG{'ALRM'}="TimeOut";

My question is what is the best function to replace with alarm
in Win32 machines...or ideas to implement the same functionality..

Thanks & Regards

Replies are listed 'Best First'.
Re: alarm function
by hgolden (Pilgrim) on Sep 25, 2006 at 17:25 UTC

    There was just some discussion about this a few days ago. Check this out: Unsupported function alarm


    Update: Now that I look back at that thread, you're the one who asked that question. What exactly do you need to know that wasn't covered in people's answers?

      Hey Hays
      The discussion was there but without any hints of solution...

      Thanks & Regards
        Hey Sridhar

        I think the consensus was that alarm is implemented in newer versions of ActivePerl, even for Windows, so you should upgrade and try again. If that still doesn't work, write back.


Re: alarm function
by jdtoronto (Prior) on Sep 25, 2006 at 20:40 UTC
    The alarm function has been implement in recent ActiveState releases, as you were told recently. The solution is their for you - update your Perl.

    Their is also Win32::ChangeNotify which will help you if you invert your logic.


Re: alarm function
by pbeckingham (Parson) on Sep 25, 2006 at 17:27 UTC

    You can achieve the same result by creating a thread, but it would be a much less cleaner solution. There are examples of this around...

    pbeckingham - typist, perishable vertebrate.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://574797]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2017-12-18 11:10 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (483 votes). Check out past polls.