David Schmidt wrote:
2009/11/30 Jay Savage <daggerqu...@gmail.com>:

Either way, you should be able to use the built-in functions to
accomplish your task. See the docs for sleep(), alarm(), and select()
for more info.

Sorry for the bad explanation of my problem.

Yes my program has to continue while waiting for the timeout.
You code example doesn't work for me because my program is an entire
Catalyst application which I dont think is a good idea to put into an
eval block.

You may not need an eval block:

perldoc -f alarm
[ SNIP ]
            If you want to use "alarm" to time out a system call you
            need to use an "eval"/"die" pair.  You can’t rely on the
            alarm causing the system call to fail with $! set to "EINTR"
            because Perl sets up signal handlers to restart system calls
            on some systems.  Using "eval"/"die" always works, modulo
            the caveats given in "Signals" in perlipc.


And besides, an eval with a block is compiled at the same time as the rest of your program and doesn't have the run-time overhead of a string eval.



John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity.               -- Damian Conway

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to