Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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
Sridhar

Comment on alarm function
Download Code
Re: alarm function
by hgolden (Pilgrim) on Sep 25, 2006 at 17:25 UTC
    Hey

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

    Hays

    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
      Sridhar
        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.

        Hays

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.
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.

    jdtoronto

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://574797]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (16)
As of 2014-09-19 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (143 votes), past polls