#!/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 = ; 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";