in reply to bidirectional challange
insert this line after that:$SIG{ALRM}=sub{rearm()};
and for the sub:$SIG{INT}=sub{process()};
now, when you press ctrl-c, instead of death you get a little ">" prompt so you can talk.sub process { print color("black on_white"), ">"; print color("reset"); my $input=<>; if ($input eq "DONE\n") {exit 0} else {print TNOUT "$input"} }
|
---|