Help for this page

Select Code to Download


  1. or download this
    my $seconds=10;
    sleep $seconds;
    my $element=shift @array;
    
  2. or download this
    $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.