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.
In reply to User interactivity in long loops by Solo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |