Cheers - L~R#!/usr/bin/perl use strict; use warnings; $SIG{INT} = sub { print "Program interuption detected!\n"; print "Press ENTER to continue or any other key to quit\n"; my $foo = <STDIN>; chomp $foo; die "\nTerminating at users request\n" if $foo; print "Resuming our regularly scheduled programming\n"; }; print "This would be your program starting up\n"; for ( 1 .. 10 ) { print "$_\n" for 1 .. 10; sleep 1; } print "This would be your program finishing cleanly\n";
In reply to Re: Resuming from a SIG{INT}
by Limbic~Region
in thread Resuming from a SIG{INT}
by jmccaf01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |