in reply to time and arrays
If, however, you want to spend your waiting time usefully, set an alarm:my $seconds=10; sleep $seconds; my $element=shift @array;
Note that this code is untested, but should give you an idea on how to proceed.$SIG{ALRM}= sub {shift @array}; my $seconds=10; alarm $seconds; do_useful_stuff(); # after 10 seconds, @array gets shifted, no matter what you are doing +at that point.
Update: First I define $seconds, than I don't use it. Fixed that :).
CU
Robartes-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: time and arrays
by FireBird34 (Pilgrim) on Jan 31, 2003 at 21:13 UTC | |
by merlyn (Sage) on Jan 31, 2003 at 23:43 UTC | |
by zengargoyle (Deacon) on Feb 01, 2003 at 00:18 UTC | |
by merlyn (Sage) on Feb 01, 2003 at 00:34 UTC |