in reply to Execute a sub in the background
) { ReadMode(use 5.010; use AnyEvent; use Term::ReadKey qw(ReadMode ReadKey); ReadMode('cbreak'); my %events; %events = ( key => AE::io(*STDIN, 0, sub { for (ReadKey) { when ('q') { ReadMode('normal'); $events{quit}->send; + } when ("\n") { say 'ZOMG, ENTER!'; } default { say } } }), quit => AE::cv, ); $events{quit}->recv;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Execute a sub in the background
by egzoti4en (Initiate) on Feb 01, 2012 at 15:14 UTC | |
by chessgui (Scribe) on Feb 01, 2012 at 15:36 UTC | |
by egzoti4en (Initiate) on Feb 01, 2012 at 15:40 UTC | |
by chessgui (Scribe) on Feb 01, 2012 at 15:47 UTC | |
by Anonymous Monk on Feb 01, 2012 at 15:53 UTC | |
|