Help for this page
my $seconds=10; sleep $seconds; my $element=shift @array;
$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.