jmccaf01 has asked for the wisdom of the Perl Monks concerning the following question:
# ./prompt2
Testing One Two Three
^CPress -=ENTER=- to Resume or 'q' to quit
<ENTER * 3 times>
Got to the end of the programme
#!/usr/bin/perl $SIG{'INT'} = sub { print "Press -=ENTER=- to Resume or 'q' to quit\n"; chomp (my $quit=<STDIN>); die "\nTerminating at users request \n" if $quit =~ /^q$/i; }; print "Testing One Two Three\n"; chomp (my $continue=<STDIN>); print "Got to the end of the programme \n";
janitored by ybiC: Balanced <code> tags around codeblock, other minor format tweaks for legibility
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Resuming from a SIG{INT}
by tinita (Parson) on Mar 16, 2004 at 17:26 UTC | |
|
Re: Resuming from a SIG{INT}
by NetWallah (Canon) on Mar 16, 2004 at 17:13 UTC | |
|
Re: Resuming from a SIG{INT}
by Limbic~Region (Chancellor) on Mar 16, 2004 at 19:26 UTC | |
by kappa (Chaplain) on Mar 16, 2004 at 20:39 UTC | |
by Limbic~Region (Chancellor) on Mar 16, 2004 at 20:50 UTC | |
|
Re: Resuming from a SIG{INT}
by kappa (Chaplain) on Mar 16, 2004 at 20:34 UTC | |
|
Re: Resuming from a SIG{INT}
by chip (Curate) on Mar 16, 2004 at 16:30 UTC | |
by jmccaf01 (Initiate) on Mar 16, 2004 at 18:07 UTC | |
by chip (Curate) on Mar 16, 2004 at 19:14 UTC |