Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: bidirectional challange

by halfcountplus (Hermit)
on Mar 14, 2008 at 03:48 UTC ( #674137=note: print w/replies, xml ) Need Help??

in reply to bidirectional challange

I couldn't figure a way to channel STDIN->TNOUT, but you could use $SIG{INT} as something to "listen for" along with the alarm, so the user can interrupt and input a line. That means you need a new way to conviently kill the whole thing (input DONE). Since TNIN is triggered initially by im2 starting the timer:
insert this line after that:
and for the sub:
sub process { print color("black on_white"), ">"; print color("reset"); my $input=<>; if ($input eq "DONE\n") {exit 0} else {print TNOUT "$input"} }
now, when you press ctrl-c, instead of death you get a little ">" prompt so you can talk.

I just tried it and it werx dandy. ROLL ON

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://674137]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2022-05-29 03:43 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (101 votes). Check out past polls.