in reply to Re^3: How to pass CTRL-C to child script only
in thread How to pass CTRL-C to child script only
during STDIN:my $stop = 0; $SIG{'INT'} = sub { $stop = 1 };
the current problem with this is that, after pressing CTRL-C, the user will have to press the enter key again to exit script B. and if the user actually wants to pass in input, the input will need to be entered twice, but I guess I will have to work around this way for this problem.print "->CQ username: "; while (<STDIN>){ if ($stop == 1){ return(0); } last; } chomp ($username = <STDIN>);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to pass CTRL-C to child script only
by CountZero (Bishop) on Aug 23, 2010 at 17:32 UTC | |
|
Re^5: How to pass CTRL-C to child script only
by spazm (Monk) on Aug 24, 2010 at 03:04 UTC | |
by spazm (Monk) on Aug 24, 2010 at 17:53 UTC |