Solo has asked for the wisdom of the Perl Monks concerning the following question:
print "Press CRTL-C to skip to next item\n"; $SIG{INT} = sub { print "skipping"; next LOOP; }; LOOP: for $item (@BigList) { print "Slowly processing $item..."; # etc }
But this doesn't work because the LOOP label is not in scope.
Is there an easy way to let user input 'abort' to the next iteration of a loop, or am I forced to introduce event polling throughout the processing section?
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: User interactivity in long loops
by Anonymous Monk on Jun 30, 2004 at 15:50 UTC | |
by Solo (Deacon) on Jun 30, 2004 at 20:16 UTC |