in reply to time and arrays

If you don't need to do anything else while you are waiting your X seconds, you simply use sleep before shifting the array:
my $seconds=10; sleep $seconds; my $element=shift @array;
If, however, you want to spend your waiting time usefully, set an alarm:
$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.
Note that this code is untested, but should give you an idea on how to proceed.

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
    Thanks all =) Robartes, that code is exactally what I needed (I needed to do "useful stuff" while it was counting). Thanks again =)

        could you sometime post some small simple example of POE? i've seen you mention it many times, i've looked at it a couple of times and keep getting lost.