in reply to Sleeping with the Enemy

I'm curious. How do you use select to cause the script to sleep for a time with a greater granularity then seconds?

Thanks!

Replies are listed 'Best First'.
RE: Re: Sleeping with the Enemy
by Boogman (Scribe) on Aug 26, 2000 at 00:17 UTC
    The fourth argument to select specifies a timeout. If you call it with blanks for the first three arguments and a value for the fourth it will timeout for that long. For example, you can effect a sleep of 250 milliseconds this way:
    select(undef, undef, undef, 0.25);
    See the perlfunc bit on select...
RE: Re: Sleeping with the Enemy
by doran (Deacon) on Aug 26, 2000 at 00:17 UTC
    From perldoc -f select:
    You can effect a sleep of 250 milliseconds this way: select(undef, undef, undef, 0.25);
    While sleep() is usually good enough, select() comes in handy sometimes.